Page 1 of 1

Pause and Resume for streaming sounds

Posted: Tue Feb 02, 2010 8:08 pm
by chris_b
It would be useful to control sounds loaded with #PB_Sound_Streaming with functions PauseSound(#Sound) and ResumeSound(#Sound).

Also a function to retrieve the current playback position of a streaming sound would be nice.

Re: Pause and Resume for streaming sounds

Posted: Tue Feb 02, 2010 9:06 pm
by inc.
Catch via IsSound() the pointer where the directsoundbuffer adress is stored and use the Directsound API for accessing the stream playback directly.


*DirectSoundBuffer.IDirectSoundBuffer = PeekL( IsSound (SoundID.l) )
*DirectSoundBuffer\GetCurrentPosition(@DXSndPosition,0)

Re: Pause and Resume for streaming sounds

Posted: Tue Feb 02, 2010 10:58 pm
by chris_b
But the DirectSound stuff isn't applicable to OS X or Linux.

Also when PureBasic plays a sound with #PB_Sound_Streaming it uses a circular Directsound buffer, so DirectSoundBuffer\GetCurrentPosition doesn't tell us how much of the Flac or Ogg sound has been decoded and sent to the buffer.