Andy's LEGO® Mindstorms® Page
About this site
  
What's New?
  
Standard Disclaimer
Quite C
  
Francesco Ferrara
  
Getting Started
  
Installing Quite C
  
Compiling a project
  
Sample Code
Chess
  
The Robot Chess Project
  
Programming Chess
  
First Attempt
  
Version 0
  
Version 1
  
The Program
  
The State of Play
  
The User Interface
  
The Move Generator
  
The Move Applier
  
The Rating Algorithm
  
The Search Algorithm
  
Putting it all together
  
The Robot
  
The Head
  
Moving the head
  
Movies
  
Downloads: Source Executables, MLCad Models
4-in-a-Robot
  
4-in-a-Robot - the Robot
  
The 4-in-a-Robot Base
  
The 4-in-a-Robot Delivery Mechanism
  
The 4-in-a-Robot Controller
  
4-in-a-Robot - the Code
  
The 4-in-a-Robot Algorithm
  
The 4-in-a-Robot Control Programming
  
The 4-in-a-Robot Robot-less version
  
Installing 4-in-a-robot
  
Playing the robotless 4-in-a-robot
  
View the source code
Speech
  
The problems with speech
  
Sounds familiar
  
H8 Timers Background
  
Trial and Error
  
Volume Zapper
  
Actually Speaking
  
Speak.c - the code
  
The VB code generator
Some ideas for the future
  
Room positioning robot
  
Neural Net Bot
  
Pianola
  
Text to speech
LEGO® Mindstorms® Links

[268745]

Actually Speaking

 

So, how to do speech?



I played around with the square-wave method until I got some reasonable results.

I found that 16KHz audio at 4 bit gave the best quality, although I haven't played around with optimising the sample such as adding a low pass filter etc.

The sample is just me saying as clearly as I could... R.C.X. Well, what do you expect, poetry? I used CoolEdit (shareware, nice program) to record and convert to raw 8 bit unsigned 16KHz, and I wrote a little VB program to take the difference from the 128 'middle line', divide by 16 and write the values two at a time to produce the C source code for an array that I could paste into the source. Not the most efficient use of space, but I wanted to get it up and running more than anything.

In the RCX code I just run through the array, set the aplitude for the high nybble of the array element, wait a bit, set the amplitude for the low nybble and wait a bit more. Timing the wait loop is pretty rough, but it's consistent and gives reasonable results.

The next page shows the source code, but with the array heavily cut down to save space



Back to: Volume Zapper

Show Topic: Speech

Next Page: Speak.c - the code