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:

  1. Run the Sound Recorder program (located somewhere in the Windows Accessories folder) and record the voice segment that you wish to use.

  2. Convert the resulting sound data to PCM format with attributes: 8.000 kHz, 8 Bit, Mono (by clicking "File" on the menu bar, selecting "Properties, and then clicking the "Convert Now" button under "Format Conversion").

  3. Save the file.

And that's all there is to it!



  [ Webmaster | FAQ's | Home Page | Contact Us ]