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.
Pause and Resume for streaming sounds
Re: Pause and Resume for streaming sounds
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)
*DirectSoundBuffer.IDirectSoundBuffer = PeekL( IsSound (SoundID.l) )
*DirectSoundBuffer\GetCurrentPosition(@DXSndPosition,0)
Check out OOP support for PB here!
Re: Pause and Resume for streaming sounds
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.
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.