Hi, I have a question regarding vcut. In the man page, it says: DESCRIPTION vcut reads an Ogg Vorbis audio file and splits it at the given cutpoint, which is a sample number. <p>What I want to do, is to cut an Ogg Vorbis file at a given time. Say, I have an Ogg Vorbis file, which is 1 hour long, and I want to cut it into two half hour parts. With a fixed bitrate format, the frame number to cut by can be easily calculated, but how do I such here? <p>Akos --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
At 08:49 AM 8/10/02 +0200, you wrote:>Hi, > >I have a question regarding vcut. In the man page, it says: > >DESCRIPTION > vcut reads an Ogg Vorbis audio file and splits it at the > given cutpoint, which is a sample number. > > >What I want to do, is to cut an Ogg Vorbis file at a given time. Say, I >have an Ogg Vorbis file, which is 1 hour long, and I want to cut it into >two half hour parts. > >With a fixed bitrate format, the frame number to cut by can be easily >calculated, but how do I such here?You use the granulepos given on each page. If you want to be more exact, you can calculate an exact per-packet offset using the granulepos and then using vorbis_packet_blocksize() as vcut does. Err... or maybe I misread your question. If you want to _use_ vcut, the offset given to it is in samples - so if you want to cut at half an hour, and your file is at 44100 Hz, use 44100*60*30 (whatever that is). Mike --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> With a fixed bitrate format, the frame number to cut by can be easily > calculated, but how do I such here?No, you can just cut and it normally works ok because MP3 headers take up 4 bytes of every frame. You do lose the bitbucket, and streaming of hte resulting file breaks a few decoders, mpg123 being one of the most sensitive. Just because the hack almost works right doesn't make it good :) jack. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.