Valhalla Legends Forums Archive | Battle.net Bot Development | Sounds on Startup

AuthorMessageTime
DrivE
Does anybody have an idea for how to insert a sound on startup? I was thinking of using a .wav or .mp3 file for this but I need an idea of where to start with it. Any input would be appreciated.
October 9, 2003, 12:45 AM
PaiD
I use sounds on my About
[code]
Private Sub mnuAbout_Click()
PlayMP3 ("About.mp3")
frmAbout.Show
End Sub
[/code]
October 9, 2003, 1:12 AM
Skywing
[quote author=Hazard link=board=17;threadid=3006;start=0#msg23482 date=1065660334]
Does anybody have an idea for how to insert a sound on startup? I was thinking of using a .wav or .mp3 file for this but I need an idea of where to start with it. Any input would be appreciated.
[/quote]

You can use the PlaySound function.

P.S. From a user standpoint, I consider programs that play sounds without good reason obnoxious.
October 9, 2003, 1:30 AM
hismajesty
[quote author=Skywing link=board=17;threadid=3006;start=0#msg23492 date=1065663012]
P.S. From a user standpoint, I consider programs that play sounds without good reason obnoxious.
[/quote]

Same :)
October 9, 2003, 1:33 AM
DrivE
I welcome input on that as well Skywing. Function is my primary purpose right now.
October 9, 2003, 1:37 AM
St0rm.iD
[quote author=PaiD link=board=17;threadid=3006;start=0#msg23488 date=1065661928]
I use sounds on my About
[code]
Private Sub mnuAbout_Click()
PlayMP3 ("About.mp3")
frmAbout.Show
End Sub
[/code]
[/quote]

Show the PlayMP3 function?
October 9, 2003, 1:55 AM
iago
I would recommend DirectMusic :-D
October 9, 2003, 3:05 AM
WiLD
I just added this 2 my bot, when errors occur it plays a sound.
[code]
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
[/code]
Just place that in a simple module or whatever
[code]
sndPlaySound "error.wav", SND_ASYNC
[/code]
place that under form load or what ever you want it triggered by and your set.

Much easier thenother methods
October 9, 2003, 12:46 PM
PaiD
[quote author=St0rm.iD link=board=17;threadid=3006;start=0#msg23501 date=1065664520]
Show the PlayMP3 function?
[/quote]
Ok
[code]
Public Sub PlayMP3(filename As String)
mciSendString "Open " & filename & " Alias MM", 0, 0, 0
mciSendString "Play MM", 0, 0, 0
End Sub
Public Sub PauseMP3(filename As String)
mciSendString "Stop " & filename & " Alias MM", 0, 0, 0
End Sub
Public Sub StopMP3(filename As String)
mciSendString "Stop MM", 0, 0, 0
mciSendString "Close MM", 0, 0, 0
End Sub

Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

[/code]
October 9, 2003, 6:56 PM
St0rm.iD
[me=St0rm.iD]points wildly at http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=21950&lngWId=1 which is a post I made 2 years ago. Looks like it's spreading :)[/me]
October 9, 2003, 10:43 PM
PaiD
:D +1 to Storm
October 10, 2003, 12:54 AM
Grok
[quote author=PaiD link=board=17;threadid=3006;start=0#msg23602 date=1065747296]
:D +1 to Storm
[/quote]

Haha. Dude you're in danger of being listened to.
October 10, 2003, 3:53 PM

Search