Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Apr 4, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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 TO "Stewart.wav",0
??CHR(7) && Rings the bell/plays the sound
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date