'  ##############
' # test28.bas #
'##############
' short test for 
' fbs_PauseRewindSound()

#include "../inc/fbsound.bi"
const data_path = "../data/"

' only if not same as exe path
' fbs_Set_PlugPath("./")

sub fbs_PauseRewindSound(hSound as integer)
  dim as short ptr pStart
  ' stop playback
  fbs_Set_SoundPaused(hSound,True)
  ' get start position
  fbs_Get_SoundPointers(hSound,@pStart)
  ' set it as current play postion
  fbs_Set_SoundPointers(hSound,,pStart)
end sub

dim as integer   hWave,hSound
print fbs_Init()
print "please wait while decode 'legends.ogg' in memory!"
fbs_Load_OGGFile(data_path & "legends.ogg",@hWave)
fbs_Create_Sound(hWave,@hSound)
fbs_Play_Sound(hSound)
print "playing for 5 seconds"
sleep 5000
print "restart sound"
' pause and rewind
fbs_PauseRewindSound(hSound)
' restart the sound
fbs_Set_SoundPaused(hSound,False)
sleep

