[vorbis-dev] Implementing looping audio

Michael Smith msmith at labyrinth.net.au
Sun Nov 25 13:24:19 PST 2001



At 11:06 AM 11/25/01 -0800, you wrote:
>> The idea is this: you have 3 vorbis streams (in a single 
>> file. Creating this can be as easy as "cat intro.ogg main.ogg 
>> outro.ogg > full.ogg").
>> 
>> Then, you just play through - when you hit EOS (end of 
>> stream, _not_ end of file), you can then make a decision - 
>> either loop back to the start (normally), or continue on 
>> (when you want to go from intro->main, or 
>> main->outro).
>
>This is an elegant solution, especially when you have multiple parts and
>don't want to precompute all the loop points.  However, what is the
>right thing to do when I find the EOS -- how do I tell it to "grab next
>stream"?

Continuing on to the next stream is the normal thing for vorbisfile to
do - unless you take explicit action, you'll get the next stream on next
ov_read(). This causes problems for people who don't write media players
that take into account that things like the number of channels can change
between substreams, but fortunately that sort of thing isn't generally
a problem in tightly controlled environments like games.

Michael

--- >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-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list