• Welcome to Valhalla Legends Archive.
 

Sounds on Startup

Started by Hazard, October 08, 2003, 07:45 PM

Previous topic - Next topic

Hazard

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.

"Courage is being scared to death - but saddling up anyway." --John Wayne

PaiD

I use sounds on my About

Private Sub mnuAbout_Click()
PlayMP3 ("About.mp3")
frmAbout.Show
End Sub

Skywing

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 function.

P.S. From a user standpoint, I consider programs that play sounds without good reason obnoxious.

hismajesty

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  :)

Hazard

I welcome input on that as well Skywing. Function is my primary purpose right now.

"Courage is being scared to death - but saddling up anyway." --John Wayne

Banana fanna fo fanna

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?

iago

I would recommend DirectMusic :-D
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


WiLD

#7
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
=_=  &&  g0dFraY  &&  -=Templar=-  @USWest

PaiD

#8
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


Banana fanna fo fanna

* 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 :)

PaiD


Grok

Quote from: PaiD on October 09, 2003, 07:54 PM
:D +1 to Storm

Haha.   Dude you're in danger of being listened to.