I'm using the Microsoft Multimedia Control V 6.0 to play wav files. Each record of an access database contains a word (or a series of words) that I want to announce. I'm using the following code:
'Handles the Sound
Private Sub cmdAnnounce_Click()
Dim SoundBite As String
If IsNull(.Fields("Sound Bite")) Then
SoundBite = ""
SoundBite = .Fields("Sound Bite")
X = PlaySound(SoundBite, 0, SND_ASYNC Or SND_MEMORY Or SND_PURGE)
I'm recording the "Sound Bite" to a wave file using the control, using a binary open statement to read the contents of the wav file into a string then storing that string into a 'memo' field of an Acc2000 database. A second question, is there a better way to store the wave information directly? The problem is that the call to PlaySound fails by crashing the application. Is there a limit on the size of the wav file? What can I change to test it? It works some of the time but when I run it in the IDE it will work 3-6 times (I haven't been able to see a pattern) then crash the app and ask me to send the notice to MS.
Also, right now I am having the user read each of the full words to record the sound bite. The database has around 800 entries right now. This database changes rarely so recording each entry is normally not a problem. However, setting it up will take quite a bit of time. Is there a way to automate this process? That isn't as important as the crash issue. Thank you for your help.