[Vorbis] Play ogg stream

xiphmont at xiph.org xiphmont at xiph.org
Mon Oct 16 09:31:24 PDT 2006


On 10/14/06, Oscar Sundbom <oscar.sundbom at swipnet.se> wrote:
> Phuoc Do skrev:
> > Hello,
> > I am trying to write a Ogg player that plays the Ogg stream sending
> > from the icecast server (similiar to WInamp).  So the player needs to
> > read the bits and send them to the sound card.  So I tried to use the
> > SDL library to do this.  However, sample rate changes in the Vorbis
> > stream which disrupt SDL playing.  I wonder what the proper way to
> > handle sample rate changes in a Vorbis stream is.  Some posts on SDL
> > mailing list talk about interpolation the bits in SDL but it sounds
> > too complicated.
>
> I'm quite certain the sample rate doesn't change during an icecast
> stream. I'm not even sure it's even possible.
> The bitrate may, however, change. That's handled by vorbis, so you don't
> have to care.
> The sample rate may differ between streams, but then you just make sure
> you re-open the sound card with the new parameters.

Not true, although many players make that erroneous assumption (eg, it
will crash iTunes).  Sample rate can change in the stream.

Closing the device and repoening is often the way it's handled.

Monty


More information about the Vorbis mailing list