Playing music files... mp3, wma, cd etc. on a player (1 Viewer)

WindSailor

Registered User.
Local time
Today, 02:27
Joined
Oct 29, 2003
Messages
239
I am considering playing music media files that can be used for presentations or stage appearances etc. The player used might have to be installed etc. on users machines, play the desired music and still have enough resources for Access to work correctly... any opinions?

Thanks,
Rick
 

ghudson

Registered User.
Local time
Today, 05:27
Joined
Jun 8, 2002
Messages
6,195
I have not seen any code to do it with MP3's but I have used this for playing wave files within an Access database.

Copy this into a public module...

Code:
Option Compare Database 
Option Explicit 

'PlayWaveFile 
Declare Function apisndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal filename As String, ByVal snd_async As Long) As Long 

Public Function PlayWaveFile(sWavFile As String) 
If apisndPlaySound(sWavFile, 1) = 0 Then 
'MsgBox "The Sound Did Not Play!" 
End If 
End Function 

Public Sub PlayWaveFile_Cord() 
Call PlayWaveFile("C:\Windows\Media\chord.wav") 
End Sub
My example will play the standard 'chord' wave file. To call it from another event in your db, just use this...

Code:
Call PlayWaveFile_Cord
 

Users who are viewing this thread

Top Bottom