[AccessD] Easy way to play audio files from Access form

Stuart McLachlan stuart at lexacorp.com.pg
Sat Dec 24 19:25:06 CST 2016


If it's a .wav file, this should do it:

Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" _
    (ByVal filename As String, ByVal snd_async As Long) As Long
    
    
Function PlayWav(sWavFile As String) As Long
    If apisndPlaySound(sWavFile, 1) = 0 Then
        MsgBox "The Sound Did Not Play!"
    End If

End Function

If it's a .mp3 file, it's not so easy.  Since they are only short, I'd recommend converting .mp3 
to .wav.  Here's one tool to do it:  http://lamexp.sourceforge.net/

  




On 24 Dec 2016 at 18:27, Tom Ewald wrote:

> What's the easiest way to play a short (couple of seconds) audio file
> from an Access form? I have Access 2013, 64-bit. This should be so
> easy. The closest I've come is using an HTML link to an MP3 file on my
> desktop, and then having to go through Microsoft's stupid warning
> every time that the file I created with my software on my desktop
> could contain a virus. Good grief. It takes longer to get through the
> unwanted warning than to play the file. I'd rather have the file in
> the table, but I couldn't get that to work, either. It's a simple app
> to help me learn a foreign language, and I'd like to have the
> pronunciation available.
> 
> Thanks, and Merry Christmas to those who, like me, celebrate it.
> 
> Tom Ewald
> Detroit Area
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list