trouble with sound

BlitzPlus Forums/BlitzPlus Beginners Area/trouble with sound

Zom(Posted 2005) [#1]
Hi, I'm trying the followng code out (I want to use something similar in a game i'm writing)

ChangeDir "c:\program files\blitzplus\derek\quadblox"
heh = LoadSound("music1.mp3")
LoopSound(heh)
PlaySound(heh)
Graphics 640, 480, 32, 2
While Not(KeyHit(1))
If KeyHit(57) Then PauseChannel(heh)
Wend
End

I've tried StopChannel as well. Neither of these functions stop the background sound from playing. (its a 5 minute mp3).

How can I stop background sound from playing? Or do I simply have to use shorter background music? That would be depressing if so.


Zom(Posted 2005) [#2]
nevermind, this apparently does what I want it to:

ChangeDir "c:\program files\blitzplus\derek\quadblox"
Graphics 640, 480, 32, 2
heh = PlayMusic("music1.mp3", 2)
While Not(KeyHit(1))
If KeyHit(57) Then ResumeChannel heh
If KeyHit(54) Then PauseChannel heh
Wend
End

sorry, but making these posts motivates me to figure these things out. haha


WolRon(Posted 2005) [#3]
BTW, I would avoid using the ChangeDir command in your release version. I'm sure you know what I mean.