Link to home
Start Free TrialLog in
Avatar of cipriano555
cipriano555

asked on

How to play a sound file when user clicks on an image in a Microsoft Access 2013 Form

Is it possible to get an application you build using Microsoft Access 2013 forms to play a sound (mpeg file) when the user clicks on an image in the form?
ASKER CERTIFIED SOLUTION
Avatar of chaau
chaau
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Note that this may get annoying to users fairly quickly...
;-)
Avatar of cipriano555
cipriano555

ASKER

It will show pictures of birds, user clicks on the picture to hear sound, for teaching. Do they have to be wav files, I have .mpg files
You can try. Most likely it will not play it. If it does not play (BTW, mpg is a video format, isn't it?) then try the BASS library. It is licenced free for non-commercial applications
You can try using the FollowHyperLink method.  As long as some software is designated as the default when your sound file's file type is opened.  So .docx are defined to open word, .xlsx are defined to open Excel, .accdb are defined to open Access.  The FollowHyperLink method is very flexible.  I haven't tried it with sound files but it is my go to method of opening all other file types since it means that I don't have to know what software is loaded that will read a .pdf file.  I just use FollowHyperLink and as long as .pdf is associated with some application, FollowHyperlink will open it.
I have mp3 sound files.  Thousands of them.  Would be very clumsy to have to convert them to .wav.
Did you try using the FollowHyperlink method?  All you need is to have an audio program associated with mp3 files so Windows knows what app to fire up when you use FollowHyperLink.
I tried the FollowHyperlink method.  I got it to play the sound using VBA in excel, with they huge disadvantage that it  brought up some huge window saying something about XBOX.  I have not got it to work with Access yet.


Private Sub Command0_Click()

Dim fileaudio As String

fileaudio = "C:\Users\cfernandez\Documents\MPEGS\0010.mp3"
Me.FollowHyperlink Address:=fileaudio


End Sub