Playing Sound Files in FoxPro Apps Quickly

Playing Sound Files in FoxPro Apps Quickly

I write language instruction programs and have been calling mplayer2 to allow students to hear the pronunciation saved in recorded sound files. But mplayer takes forever to load and play. So do all the other executable programs that I have, such as xrecord.

By contrast, Windows can play .wav files instantly. If I could load and play small .wav files that fast I could greatly improve my language program. (There must be some subfile of Windows that plays its sound files so quickly.)

What other .exe files are there that load and play very quickly under FoxPro? Using verbs in FoxPro is even slower than calling .exe files for some reason.

Visual FoxPro lets you set the bell sound (using the SET BELL TO command) to a .wav file. You can then play the bell sound by executing the command:


For example, let’s say that you have a .wav file called Stewart.wav. Here is the code that will cause the .wav file to play:

SET BELL ONSET BELL TO "Stewart.wav",0??CHR(7) && Rings the bell/plays the sound


Share the Post: