P
Preschool Mike
I'm using the following code to play a sound or music in a game I made for my
class, however I don't always want to wait for the sound or song to finish.
How can I stop the song/sound? Need code to stop a sound/song from
completing. Or would I use some type of Exit Sub procedure? If so, don't
know how to code.
Dim RandomSong As Integer
Sub PlayRandomSong()
RandomSong = Int((4 - 1 + 1) * Rnd + 1)
If RandomSong = 4 Then
CenterField
ElseIf RandomSong = 3 Then
StadiumCheer
ElseIf RandomSong = 2 Then
TakeMeToBallGame
ElseIf RandomSong = 1 Then
Booing
End If
End Sub
Sub CenterField()
Call sndPlaySound32 _
("C:\centerfield", 0)
End Sub
Sub TakeMeToBallGame()
Call sndPlaySound32 _
("C:\outtoballgame", 0)
End Sub
Sub StadiumCheer()
Call sndPlaySound32 _
("C:\stadiumroar", 0)
End Sub
Sub Booing()
Call sndPlaySound32 _
("C:\booing", 0)
End Sub
class, however I don't always want to wait for the sound or song to finish.
How can I stop the song/sound? Need code to stop a sound/song from
completing. Or would I use some type of Exit Sub procedure? If so, don't
know how to code.
Dim RandomSong As Integer
Sub PlayRandomSong()
RandomSong = Int((4 - 1 + 1) * Rnd + 1)
If RandomSong = 4 Then
CenterField
ElseIf RandomSong = 3 Then
StadiumCheer
ElseIf RandomSong = 2 Then
TakeMeToBallGame
ElseIf RandomSong = 1 Then
Booing
End If
End Sub
Sub CenterField()
Call sndPlaySound32 _
("C:\centerfield", 0)
End Sub
Sub TakeMeToBallGame()
Call sndPlaySound32 _
("C:\outtoballgame", 0)
End Sub
Sub StadiumCheer()
Call sndPlaySound32 _
("C:\stadiumroar", 0)
End Sub
Sub Booing()
Call sndPlaySound32 _
("C:\booing", 0)
End Sub