delay question

BlitzMax Forums/BlitzMax Programming/delay question

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.

Cruis.In, klepto's routine works, but you need to put it in a loop. If you don't, it will start the sound and then run onto the next instruction a microsecond or less later, and check to see if the sound is still playing. Obviously it will be... you need to continuously check for long enough for the sound to stop playing. Maybe something like:

Repeat
  If Keyhit(Key_Tab)
   Channel = playSound(Sound)
  Endif

  If ChannelPlaying(Channel) = False Then Exit
Forever

state1
state2
state3