[vorbis-dev] Implementing looping audio

Brian Hook brianhook at pyrogon.com
Fri Nov 23 12:11:23 PST 2001



I have a soundtrack that I need to loop, specifically something like:

intro
*A*
main
*B*
outro

Where I need to loop between *A* and *B* indefinitely.  It seems that
the fairly straightforward way of doing this is to use ov_pcm_tell()
when reading my next chunk, and doing something like:

if ( ov_pcm_tell() + chunkSize > MARKER_B )
{
   ov_read( /* enough bytes to reach MARKER_B */ );
   ov_pcm_seek( MARKER_A );
   ov_read( /* remaining bytes */ );
}
else
{
   ov_read( /* chunkSize */ );
}

Seems straightforward enough, but I was wondering if there was a
standard way of doing this before I go off and write something only to
find out I did it the stupid way =)

Thanks,

Brian

--- >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