play wav 
Author Message
 play wav

win98, access 2000

in VBA, how to play wav sound on click event and form load event? the sound
is embeded in the form. thanks.



Sat, 07 Aug 2004 23:55:00 GMT  
 play wav
This is the way I know http://www.mvps.org/access/api/api0011.htm

I don't know what you mean by "embedded in the form".

Marsh



Quote:
>win98, access 2000

>in vba, how to play wav sound on click event and form load event? the sound
>is embeded in the form. thanks.



Sun, 08 Aug 2004 06:16:28 GMT  
 play wav
Module:

Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal
filename As String, ByVal snd_async As Long) As Long
Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long

Public Function PlaySound(msound)
  Dim XX%
  Dim rtn As Integer
  rtn = waveOutGetNumDevs()  'check for a sound card in the machine
  If rtn = 1 Then   'a sound card exists
    XX% = apisndPlaySound(msound, 1) 'play mmwave sound
  Else  ' no sound card was found
  End If

  'If XX% = 0 Then MsgBox ("The Sound Did Not Play! Because you don't have a
sound card.")
End Function

and Load OnClick Event:

'PlaySound ("C:\WINDOWS\CHIMES.WAV")        'or
PlaySound ("G:\Data\Access\MDI\CHIMES.WAV") 'this works on network, if u not
shure that all users have the sound file in their C:\Win.....directory. Note
that u must copy the sound file to this network dir.

paul


Quote:
> win98, access 2000

> in vba, how to play wav sound on click event and form load event? the
sound
> is embeded in the form. thanks.



Mon, 09 Aug 2004 02:40:05 GMT  
 play wav
oops, I forgot to give credit for this code. It was given to me by someone
in this ng. Sorry
Paul


Quote:
> Module:

> Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal
> filename As String, ByVal snd_async As Long) As Long
> Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long

> Public Function PlaySound(msound)
>   Dim XX%
>   Dim rtn As Integer
>   rtn = waveOutGetNumDevs()  'check for a sound card in the machine
>   If rtn = 1 Then   'a sound card exists
>     XX% = apisndPlaySound(msound, 1) 'play mmwave sound
>   Else  ' no sound card was found
>   End If

>   'If XX% = 0 Then MsgBox ("The Sound Did Not Play! Because you don't have
a
> sound card.")
> End Function

> and Load OnClick Event:

> 'PlaySound ("C:\WINDOWS\CHIMES.WAV")        'or
> PlaySound ("G:\Data\Access\MDI\CHIMES.WAV") 'this works on network, if u
not
> shure that all users have the sound file in their C:\Win.....directory.
Note
> that u must copy the sound file to this network dir.

> paul



> > win98, access 2000

> > in vba, how to play wav sound on click event and form load event? the
> sound
> > is embeded in the form. thanks.



Mon, 09 Aug 2004 22:38:27 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Play WAV sound on event??

2. access V7 play WAV?

3. Access V7 play WAV?

4. play wav in access 7?

5. Problem playing wav file from code in VBA

6. How to play Wav files

7. I cant play Wav files in my prodject.

8. automatically playing wav files in a document

9. Playing WAV from Embedded Resource

10. Playing .wav files in a ASP.NET Web Application

11. How to play WAV files saved in Access table

12. Playing wav files with Tapi

 

 
Powered by phpBB® Forum Software