[vorbis-dev] Implementing looping audio

OmegaDan dan at morrione.net
Fri Nov 23 14:29:26 PST 2001



I have been working on something similar for my own
(video game) projects ... Although I haven't worked on
it in almost 9 mos, i wrote a (DirectX) sound
effects/music unit that used the vorbis to store
sfx/music loops ... I found a wrapper to the vorbis
code, was much easier then modifying the code.  If you
modify vorbis directly -- you will have to modify it
every time there is a new release.

--- Brian Hook <brianhook at pyrogon.com> wrote:
> 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.

=====
Daniel "OmegaDan" Morrione [dan at morrione.net]
thehumbleguys music group - "Everything but love songs"
Scoring / Sound Design / Audio Programming
thehumbleguys.com [omegadan at thehumbleguys.com]
-
Monkelectric - Internationally ignored musicians.
monkelectric.com

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

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