Loadsound sync?

Blitz3D Forums/Blitz3D Programming/Loadsound sync?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi all,

I've got a little issue I'd like to share, I have a demo that's time synced to a soundtrack. The problem is that the first time you run the program it seems to have a 1 second delay in playing the soundfile - so everything is off (timewise). Running the demo again it seems the sound file is cached or something because it functions as expected.

My question is, how do I know a soundfile is really loaded and ready to play?

My code obviously doesn't work:

s=LoadSound("intro.wav")
done=False
Repeat
If s<>0 Then done=True
Until done=True
PlaySound S

Can anyone help?

-R