GetSoundPlaying
PlayingStatus = GetSoundPlaying(SoundIndex)
 
Parameters:

    SoundIndex = The Index of the sound you wish to query
Returns:

    PlayingStatus = The status of the sound you queried
 

GetSoundPlaying will return the current play or pause status of a selected sound. Since it returns both the play and pause status combined, you'll need to be familiar with what the meaning of the return values bellow.

[ PlayingStatus Values ]

0 = Sound is not playing or paused
1 = Sound is playing
2 = Sound is paused, not but playing.
3 = Sound is paused while playing.



FACTS:


* GetSoundPlaying can NOT return the status of sounds that have been dyanmically played with PlayDynamicSound




Mini Tutorial:


This example loads a sound file and plays it. The main Do/Loop then montiors this sounds playing status. If the sound stops playing (it finnishes) then it will play it again. To simulate looping the sound


  
  
; Load a sound file into Sound 1
  LoadSound "SoundFile.wav",1
  
; Begin playing the looped sound.
  PlaySound 1
  
; Start a Do/loop
  Do
     
   ;Clear the Screen to black
     Cls RGB(0,0,0)
     
   ; display a message
     Print "This example monitors the PLay State of Sound 1"
     
   ; Check the Sound 1 current playing status
     If GetSoundPlaying(1)=0
      ; The SOund has stopped playing, so restart it
        PlaySound 1
      ; Flash a message to Show it's time to play the sound
      ; again
        Print "Re-playing Sound"
     EndIf
     
     
   ; display the screen
     Sync
   ; Loop back to the DO statement.
  Loop
  
  



 
Related Info: PauseSound | PlaySound | SoundFreq | SoundMasterVolume | SoundPan | SoundVolume :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com