Hello
I am looking for the required OCX/DLL to enable a sound player to my program (ie: Goto your Control Panel/Sounds). The play and stop function is what I am in search for. Any help would be appreciated, thank you
mikel
Printable View
Hello
I am looking for the required OCX/DLL to enable a sound player to my program (ie: Goto your Control Panel/Sounds). The play and stop function is what I am in search for. Any help would be appreciated, thank you
mikel
Look through the BB archives, it's the kind of question that appears all the time. In reply, here is some code I got from Serge's post
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
Place this code on your button to play wav
PlayWav "C:\Mysound.wav"
If your looking for a console-based player (with buttons and length etc), use the Windows Media Player control.
Regards,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it :)
[This message has been edited by chrisjk (edited 12-01-1999).]
But what about a stop command?
Call the Function Again using the SND_PURGE Flag:
Private Const SND_PURGE = &H40
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Thank you, both of you