IFusionSoundStream represents a ring buffer for streamed
playback which fairly maps to writing to a sound device. Use it for easy
porting of applications that use exclusive access to a sound device.
Writing to the ring buffer triggers the playback if it's not
already running. The method Write() can be called with an arbitrary
number of samples. It returns after all samples have been written to the
ring buffer and sleeps while the ring buffer is full.
Blocking writes are perfect for accurate filling of the buffer,
which keeps the ring buffer as full as possible using a very small block
size (depending on sample rate, playback pitch and the underlying hardware).
Waiting for a specific amount of free space in the ring buffer
is provided by Wait(). It can be used to avoid blocking of
Write() or to finish playback before destroying the interface.
Status information includes the amount of filled and
total space in the ring buffer, along with the current read and
write position. It can be retrieved by calling GetStatus() at
any time without blocking.
Methods of IFusionSoundStream |