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.
I use sounds on my About
Private Sub mnuAbout_Click()
PlayMP3 ("About.mp3")
frmAbout.Show
End Sub
Quote from: Hazard on October 08, 2003, 07:45 PM
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.
You can use the PlaySound (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_playsound.asp) function.
P.S. From a user standpoint, I consider programs that play sounds without good reason obnoxious.
Quote from: Skywing on October 08, 2003, 08:30 PM
P.S. From a user standpoint, I consider programs that play sounds without good reason obnoxious.
Same :)
I welcome input on that as well Skywing. Function is my primary purpose right now.
Quote from: PaiD on October 08, 2003, 08:12 PM
I use sounds on my About
Private Sub mnuAbout_Click()
PlayMP3 ("About.mp3")
frmAbout.Show
End Sub
Show the PlayMP3 function?
I would recommend DirectMusic :-D
I just added this 2 my bot, when errors occur it plays a sound.
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
Just place that in a simple module or whatever
sndPlaySound "error.wav", SND_ASYNC
place that under form load or what ever you want it triggered by and your set.
Much easier thenother methods
Quote from: St0rm.iD on October 08, 2003, 08:55 PM
Show the PlayMP3 function?
Ok
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
/me 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 :)
:D +1 to Storm
Quote from: PaiD on October 09, 2003, 07:54 PM
:D +1 to Storm
Haha. Dude you're in danger of being listened to.