sound help

Blitz3D Forums/Blitz3D Beginners Area/sound help

mtnhome3d(Posted 2008) [#1]
why can't I get sound to play?
Here's my code:
Graphics 800,60,16,2
Global milsec=CreateTimer(1)
Global secs=0
Global mins=0
Global hours=0
beep=LoadSound("CUICA1.wav")
LoopSound beep

Repeat
Locate 0,0
Print "press up arrow for a timer."
Print "press down arrow for a clock."
Print" "
If KeyHit(200) timer()
If KeyHit(208) clock()
Until KeyHit(1)
;******************************************************************
Function timer()
Locate 0,0
Cls
hours=Input("hours? ")
Locate 0,0
Cls
mins=Input("minutes? ")
Locate 0,0
Cls
secs=Input("seconds? ")
Locate 0,0
Cls
While Not KeyHit(1)
Locate 0,0
Cls
Text 40,0,":"+secs,0,0
Text 15,0,":"+mins,0,0
Text 0,0,hours,0,0
WaitTimer milsec
secs=secs-1
If secs<0
secs=60
mins=mins-1
Else If mins=-1
mins=0
secs=0
hours=0
PlaySound (beep)
End If
If mins<0
mins=60
hours=hours-1
End If
If hours=-1
mins=0
secs=0
hours=0
PlaySound beep
End If

Wend
End
End Function
;************************************************************************************************
Function clock()
gettime()
While Not KeyHit(1)
Locate 0,0
Cls
Text 40,0,":"+secs,0,0
Text 15,0,":"+mins,0,0
Text 0,0,hours,0,0
WaitTimer milsec
secs=secs+1
If secs>60
secs=0
mins=mins+1
End If
If mins>60
mins=0
hours=hours+1
End If
Wend
End
End Function

Function gettime()
time$=CurrentTime()
hours=Left$(time$,2)
mins=Mid$(time$,4,2)
secs=Right$(time$,2)
End Function


KillerX(Posted 2008) [#2]
You need to make the sound beep a global variable


mtnhome3d(Posted 2008) [#3]
oh ok i'll try that


mtnhome3d(Posted 2008) [#4]
thanks
now i can use this as an extreme eggtimer lol