PDA

Click to See Complete Forum and Search --> : someone help


n1s
Nov 16th, 1999, 11:22 AM
If asked this question before I know but I really need to be able to play sounds on Vb3

can someone please help me with a code? anyone?

Serge
Nov 16th, 1999, 06:19 PM
You can use sndPlaySound API.


Private Declare Function sndPlaySound Lib "WinMM.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Private Const SND_NODEFAULT = &H2
Private Const SND_FLAG = SND_ASYNC Or SND_NODEFAULT


Public Sub PlayWav(pWavFile As String)
If Dir(pWavFile) <> "" Then
Call sndPlaySound(pWavFile, SND_FLAG)
End If
End Sub


Usage: PlayWav WaveFileName
Example: PlayWav "C:\MiFile.wav"

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)