Play WAV sound on event?? 
Author Message
 Play WAV sound on event??

Can any one share with me how I can play a wav sound on the click of a
command button, or the closing of a form??

I have tried this approach in a module:
Dim var
 var = Shell("C:\WINDOWS\SNDREC32.EXE c:\windows\media\dogbrk.wav ", 1)
This brings up the sound recorder with the proper wav to play but how do I
get it to play??
I have a short cut on my desktop that when double clicked automatically
opens and plays this sound the command line looks like this:
C:\windows\sndrec32.exe "c:\windows\media\dogbrk.wav" /play
But this does not seem to work in my code.

Please help

Brett



Sat, 15 Jul 2000 03:00:00 GMT  
 Play WAV sound on event??

I've had success with the built-in function PlaySound:

PlaySound ("pathname\filename.wav")

Maybe it will work for you, too
Keri

Quote:

> Can any one share with me how I can play a wav sound on the click of a
> command button, or the closing of a form??

> I have tried this approach in a module:
> Dim var
>  var = Shell("C:\WINDOWS\SNDREC32.EXE c:\windows\media\dogbrk.wav ", 1)
> This brings up the sound recorder with the proper wav to play but how do I
> get it to play??
> I have a short cut on my desktop that when double clicked automatically
> opens and plays this sound the command line looks like this:
> C:\windows\sndrec32.exe "c:\windows\media\dogbrk.wav" /play
> But this does not seem to work in my code.

> Please help

> Brett



Sun, 16 Jul 2000 03:00:00 GMT  
 Play WAV sound on event??

Keri,
can't find it in access, what version you use?
Best regards,
___________
Alex Dybenko
Point Limited

Home Page: http://www.geocities.com/SiliconValley/Heights/5091/
Moscow MS Access User Group, chairman
http://www.arimsoft.ru/msaccess

Quote:

>I've had success with the built-in function PlaySound:

>PlaySound ("pathname\filename.wav")

>Maybe it will work for you, too
>Keri


>> Can any one share with me how I can play a wav sound on the click of a
>> command button, or the closing of a form??

>> I have tried this approach in a module:
>> Dim var
>>  var = Shell("C:\WINDOWS\SNDREC32.EXE c:\windows\media\dogbrk.wav ", 1)
>> This brings up the sound recorder with the proper wav to play but how do
I
>> get it to play??
>> I have a short cut on my desktop that when double clicked automatically
>> opens and plays this sound the command line looks like this:
>> C:\windows\sndrec32.exe "c:\windows\media\dogbrk.wav" /play
>> But this does not seem to work in my code.

>> Please help

>> Brett



Mon, 17 Jul 2000 03:00:00 GMT  
 Play WAV sound on event??

97

Quote:

> Keri,
> can't find it in access, what version you use?
> Best regards,
> ___________
> Alex Dybenko
> Point Limited

> Home Page: http://www.geocities.com/SiliconValley/Heights/5091/
> Moscow MS Access User Group, chairman
> http://www.arimsoft.ru/msaccess

> >I've had success with the built-in function PlaySound:

> >PlaySound ("pathname\filename.wav")

> >Maybe it will work for you, too
> >Keri


> >> Can any one share with me how I can play a wav sound on the click of a
> >> command button, or the closing of a form??

> >> I have tried this approach in a module:
> >> Dim var
> >>  var = Shell("C:\WINDOWS\SNDREC32.EXE c:\windows\media\dogbrk.wav ", 1)
> >> This brings up the sound recorder with the proper wav to play but how do
> I
> >> get it to play??
> >> I have a short cut on my desktop that when double clicked automatically
> >> opens and plays this sound the command line looks like this:
> >> C:\windows\sndrec32.exe "c:\windows\media\dogbrk.wav" /play
> >> But this does not seem to work in my code.

> >> Please help

> >> Brett



Mon, 17 Jul 2000 03:00:00 GMT  
 Play WAV sound on event??

Hmm, does anyone can find PlaySound in Access 97?

Quote:

>97


>> Keri,
>> can't find it in access, what version you use?
>> Best regards,
>> ___________
>> Alex Dybenko
>> Point Limited

>> Home Page: http://www.geocities.com/SiliconValley/Heights/5091/
>> Moscow MS Access User Group, chairman
>> http://www.arimsoft.ru/msaccess

>> >I've had success with the built-in function PlaySound:

>> >PlaySound ("pathname\filename.wav")

>> >Maybe it will work for you, too
>> >Keri



Mon, 17 Jul 2000 03:00:00 GMT  
 Play WAV sound on event??

Okay - this is my punishment (or, more accurately, yours) for answering
questions while fighting with my own problems.

I apologize.  PlaySound is not a built in function.  It is a user
defined function:

Function PlaySound(Soundfile As Variant)
PlaySound = Shell("sndrec32.exe /play /close " & Soundfile)
End Function

Sorry...

Quote:

> Hmm, does anyone can find PlaySound in Access 97?


> >97


> >> Keri,
> >> can't find it in access, what version you use?
> >> Best regards,
> >> ___________
> >> Alex Dybenko
> >> Point Limited

> >> Home Page: http://www.geocities.com/SiliconValley/Heights/5091/
> >> Moscow MS Access User Group, chairman
> >> http://www.arimsoft.ru/msaccess

> >> >I've had success with the built-in function PlaySound:

> >> >PlaySound ("pathname\filename.wav")

> >> >Maybe it will work for you, too
> >> >Keri



Mon, 17 Jul 2000 03:00:00 GMT  
 Play WAV sound on event??

Hi,
I worked some time ago a less sophisticated code that works very well
and uses a registry entry to look up the WAV directory here's the
code:
============Begin Code==================
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA"
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub tone(ByVal Tn As Variant)

Dim wdir As String, I As Integer
On Local Error GoTo Err_tone
wdir = GetSetting(RegApp, RegGlobal, "sounddir", ".") & "\"

If IsNull(wdir) Then
    Tn = 0
ElseIf Dir$(wdir + "*.wav") = "" Then
    Tn = 0
End If

If VarType(Tn) = 8 Then ' string
    I = sndPlaySound(wdir + Tn + ".wav", 1)
Else
    Beep
End If
Exit Sub

Err_tone:
    Beep
    Exit Sub
End Sub



Sun, 23 Jul 2000 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Playing a WAV sound on a click event.

2. Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc)

3. Playing sounds even if other applications are playing sounds

4. Req help with how to play a .wav sound in Access

5. Playing sound (wav) in vb.net

6. Play WAV sounds in VB.NET

7. Detecting sound card for playing WAV files

8. Dial a phone and play wav sound?

9. How do I play sounds (not .wav)?

10. Play sound without .wav..

11. Play sound without .wav..

12. How to play .WAV sounds?

 

 
Powered by phpBB® Forum Software