Pause and Resume for streaming sounds

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
chris_b
Enthusiast
Enthusiast
Posts: 103
Joined: Sun Apr 27, 2003 1:54 am

Pause and Resume for streaming sounds

Post 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.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Pause and Resume for streaming sounds

Post 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)
Check out OOP support for PB here!
chris_b
Enthusiast
Enthusiast
Posts: 103
Joined: Sun Apr 27, 2003 1:54 am

Re: Pause and Resume for streaming sounds

Post 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.
Post Reply