|
|
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
|
|