Playing sounds

  • Thread starter Thread starter Sameh Ahmed
  • Start date Start date
S

Sameh Ahmed

Hello there
How can I play a certain sound (Wav or MP3) when I click a button for
example?
Thanks in advance
Regards
Sameh
 
Hi,

You can use the sndplaysound api to play a wave file.


Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Integer) As Integer

Const SND_ASYNC As Integer = &H1 ' play asynchronously



sndPlaySound("C:\tada.wav", SND_ASYNC)



Ken

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

Hello there
How can I play a certain sound (Wav or MP3) when I click a button for
example?
Thanks in advance
Regards
Sameh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top