How to use IsSound()

Just starting out? Need help? Post your questions and find answers here.
Stefan
Posts: 160
Joined: Mon Feb 05, 2018 9:44 pm

How to use IsSound()

Post by Stefan »

Code: Select all


 InitSound()
  
  Procedure Loading(Type, Filename$, ObjectId)
    Debug Filename$ + " loaded (id = " + ObjectId + ")"
    
   ; PlaySound(0) ; play the sound
  EndProcedure
    
  Procedure LoadingError(Type, Filename$)
    Debug Filename$ + ": loading error"
 
 
  Debug IsSound(0)
  Debug IsSound(testsound)
 
  EndProcedure
    
  ; Register the loading event before calling any resource load command
  BindEvent(#PB_Event_Loading, @Loading())
  BindEvent(#PB_Event_LoadingError, @LoadingError())
  
  LoadSound(0, "Data/Lazer.wav") ; Be sure this sound is available (the source file should be saved in the SpiderBasic/Examples drawer)
  testsound.i=LoadSound(#PB_Any,"nosound.mp3")
 


Could it be that Isound() isn't working or what am I doing wrong?
Even though the sound to be loaded does not exist, Issound() shows that the sound is valid and correctly initialized.