Incorporating Speech Into
Your Pro-SiMPLE Programs
If you would like your SiMPLE program to be able to "talk" to its users, simply create the appropriate .WAV files, and then write your program in Ultra-SiMPLE. (Ultra-SiMPLE gives you the ability to incorporate multi-media files into a program.) But if you aren't very fussy about the quality of speech that is generated, it is possible to get Pro-SiMPLE to play wave files through the computer's built-in speaker.
To demonstrate this cabability, first download the sample voice-data file ("voice.wav") to the root directory of your "C:" drive (by right-clicking the following link and selecting "Save Target As..."):
(Right-click Me and Select "Save Target As...")
Then run the following short Pro-SiMPLE program:
// SiMPLE-Talker
Pro-SiMPLE
Int data, eof
delay = 500
open a ("read c:\\voice.wav"); cls
tabxy (30, 7); Display "I AM SIMPLE-TALKER!"
tabxy (30, 9); Display "CAN YOU UNDERSTAND ME?"
Do
read binary a (data, eof)
If (eof) Break
If (data>127) sound (20)
Else nosound
Do k = 0, delay
x = sqrt(2)
Loop
Loop
close a
quit
[The "delay = 500" statement (located near the top of the listing) determines how fast the speech is played. You will probably have to adjust the number up or down somewhat depending on the speed of your computer.]
Creating Your Own Voice-Data Files
If you have a microphone and a sound card, it's easy to create a voice-data file -- Simply use the "Sound Recorder" program in Windows:
And that's all there is to it!
[
Webmaster |
FAQ's |
Home Page |
Contact Us ]