|
-
Jul 17th, 2000, 10:32 AM
#1
Thread Starter
Member
how can i play wav file soound from vb.
-
Jul 17th, 2000, 10:40 AM
#2
Use the PlaySound API. Make a Form with a CommandButton and put the following code into it.
Code:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Command1_Click()
'Play the WAV
PlaySound "C:\MyFile.wav", 0&, &H1
End Sub
-
Jul 17th, 2000, 10:41 AM
#3
Fanatic Member
You can use the microsoft multimedia control
OCX in your componets list
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 17th, 2000, 10:46 AM
#4
_______
<?>
Code:
' bas module code
'API Function to play the sound
'
Public Declare Function sndPlaySound Lib "winmm" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
'
' play synchronously (default)
Public Const SND_SYNC = &H0
' play asynchronously
Public Const SND_ASYNC = &H1
' loop the sound until next
Public Const SND_LOOP = &H8
'form code
Private Sub Command1_Click()
Call sndPlaySound(ByVal "c:\yourfolder\yourfile.wav", SND_ASYNC)
End Sub
Private Sub Command2_Click()
Call sndPlaySound(0,0)
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|