S.A.M. as an Arduino Library - Software to make our robots talk
July 13, 2012
Back in the good old days of Atari's and Commodore64's there was a program called S.A.M. the software automated mouth. Considering this was available about 30 years ago I have always been dissapointed at the lack of progress in robotic speach since then.
I know there is some much better speech programs available now but how often have you had a computer talk to you?
S.A.M. is actually built into Adobe Reader. Just open a PDF file, go to the "View" menu and at the bottom you will find "Read Aloud".
After looking at the price of the Speakjet chipset I decided there had to be a better way so I went to research S.A.M. It seems SAM is a small (39K) C language program and the source code is freely available here: http://simulationcorner.net/index.php?page=sam
Unfortunately I am not a programmer so for me to make this into an Arduino library is not practical but I know many of our LMR members are. I am hoping someone will be able to convert this to an Arduino library free for everyone to use.
Because of the memory size it might only work on the Mega series of Arduinos but that would still be cool. It is cheaper to but an Arduino Mega than to buy a Speakjet chipset and you get a lot more Arduino goodness to play with.
Below is an example of a simple "Serial Input - Audio Output" circuit that might be used with such software.
Here is an I2C version:
The first Serial In - Audio Out, circuit requires the processor to send 8 serial bits followed by a pulse to the "update" pin. This cycle would have to be repeated at the sample frequency of the sound being played. This circuit uses an 8-bit shift register to covert the serial data to parallel and an R2R ladder to convert the parallel data to analog.
The second circuit works the same way except using a 12-bit SMD I2C DAC. If your audio sample is only 8-bit then make your 4 least significant bits 0's. If your audio sample is 16-bit then only send the 12 most significant bits.
With both circuits I have shown an audio amplifier that is commonly found in cheap computer speakers. At 5V it will deliver up to 1.4W into an 8Ω speaker with surprisingly little distortion.