Fisher
xTeam
If a Stamped Ever Happens to Run at You, Never Stop and Shout Jumangi, it Doesn't Work!!!!
Posts: 3,187
|
sounds
Feb 18, 2004 16:46:59 GMT -5
Post by Fisher on Feb 18, 2004 16:46:59 GMT -5
ive only started learnin vb and i cant figure out how to get a sound to play on startup?
i think it would go in form load but im not sure how to get it to work. anyone any ideas? its an mp3 sound file
i probally need the play code, anyone know what it is?
|
|
|
sounds
Feb 18, 2004 19:42:36 GMT -5
Post by AbsoluteGenius on Feb 18, 2004 19:42:36 GMT -5
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub PlayWaveFile(vntWave As Variant, Optional bWait As Boolean = False) If vntWave = "" Then Exit Sub End If If bSoundsOn Then If Dir(vntWave) <> "" Then If bWait Then sndPlaySound vntWave, 2 Else sndPlaySound vntWave, 1 End If End If End If End Sub
Just call the PlayWaveFile with the path to the sound file in vntWave
Simple
|
|
tulip
New Member
Posts: 40
|
sounds
Feb 18, 2004 19:44:32 GMT -5
Post by tulip on Feb 18, 2004 19:44:32 GMT -5
Hey AG, nice to see you again.......been awhile!
|
|
|
sounds
Feb 18, 2004 19:46:56 GMT -5
Post by AbsoluteGenius on Feb 18, 2004 19:46:56 GMT -5
I knock around the boards often
|
|
Fisher
xTeam
If a Stamped Ever Happens to Run at You, Never Stop and Shout Jumangi, it Doesn't Work!!!!
Posts: 3,187
|
sounds
Feb 19, 2004 8:47:43 GMT -5
Post by Fisher on Feb 19, 2004 8:47:43 GMT -5
yeah weclome back:P lol also....im still gettin a problem:P lol
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Compile Error[img]http://proboards8.com/boardimages/sad.gif[/img]br] Constants, fixed-length strings, arrays, user-defined types and Declare statements not allowed as as Public members of object modules
no idea wat its tellin me lol
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
sounds
Feb 19, 2004 15:49:31 GMT -5
Post by Tewl on Feb 19, 2004 15:49:31 GMT -5
then declare it private lol
|
|
|
sounds
Feb 19, 2004 17:00:46 GMT -5
Post by AbsoluteGenius on Feb 19, 2004 17:00:46 GMT -5
Sorry I should of said put the delare in a module along with the subroutine
Then call the sub with a path to the sound file you want to play
|
|
Fisher
xTeam
If a Stamped Ever Happens to Run at You, Never Stop and Shout Jumangi, it Doesn't Work!!!!
Posts: 3,187
|
sounds
Feb 20, 2004 8:22:50 GMT -5
Post by Fisher on Feb 20, 2004 8:22:50 GMT -5
ok ty:P
|
|
Fisher
xTeam
If a Stamped Ever Happens to Run at You, Never Stop and Shout Jumangi, it Doesn't Work!!!!
Posts: 3,187
|
sounds
Mar 4, 2004 7:58:53 GMT -5
Post by Fisher on Mar 4, 2004 7:58:53 GMT -5
still gettin a problem, it wont play the sound, but i aint getting any errors for some reason.
i cant post the code cause i dont have the internet at home atm, this gota be in tomorrow, am flowered lol, i thought it was next week, rosygarden lol.
anyone know exactly how to do this? what part goes were etc?
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
sounds
Mar 4, 2004 12:59:48 GMT -5
Post by Tewl on Mar 4, 2004 12:59:48 GMT -5
i dont think it works for a mp3
I use the midi apis to play mp3s
|
|
|
sounds
Mar 9, 2004 4:08:58 GMT -5
Post by AbsoluteGenius on Mar 9, 2004 4:08:58 GMT -5
Yeah, the code I posted will only play .WAV files
|
|