|
-
Dec 1st, 1999, 07:14 AM
#1
Thread Starter
Junior Member
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
-
Dec 1st, 1999, 09:13 AM
#2
PowerPoster
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).]
-
Dec 2nd, 1999, 03:07 AM
#3
Thread Starter
Junior Member
But what about a stop command?
-
Dec 2nd, 1999, 03:12 AM
#4
Call the Function Again using the SND_PURGE Flag:
Private Const SND_PURGE = &H40
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Dec 2nd, 1999, 05:28 AM
#5
Thread Starter
Junior Member
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
|