is it possible to do this with the basic atom?
There are a number of ways to generate speech with microcontrollers, but they’re all going to involve using external modules, rather than generating them within the micro itself.
When it comes to speech generation, you’ve basically got two choices, each of which comes with a tradeoff. One is phoneme- or allophone-based generation, which has an effectively unlimited vocabulary, but you’ve got to build each word yourself from allophones - building blocks of speech. This usually results in fairly mechanical, “robotic” sounding speech, though it’s getting better.
The other option involves a preset vocabulary of actual recorded speech. This provides a very natural speech pattern, but is pretty limited in vocabulary, since you only have what’s been recorded ahead of time. Most robots can get away with this approach though, since you’ll usually only need a set vocabulary to begin with. You can record whole phrases together, or individual words and string them together. Keep in mind though, that by stringing individual words together usually results in somewhat stilted-sounding speech, since they don’t flow naturally into each other.
There’s a third option that’s becoming available now, which uses dynamic speech generation similar to what you’d see on a computer, and some of the units will do at least some text-to-speech, freeing you up from having to deconstruct your words before having the robot say them.
All of these options, however, are available as outriding modules to the microcontroller. As far as I know, the Atom is only capable of producing two “voices” of single-frequency tones simultaneously, though you might be able to mix that together with hardware PWM to fudge a third voice out of it. Still, it’s just beeps and boops.
so your saying i could have the atom “poke” or “write” a voice and then exacute it when somthing happens?
No, not as such.
As I said above, the Atom cannot generate speech - you will need some sort of external board to do that.
Two common ways of generating speech:
Lynxmotion used to sell a chip called the SpeakJet. I can’t find it listed anymore, so either I missed it, or he doesn’t carry it anymore. It’s still available from various sources, though. It communicates via a serial line, and generates allophone-based speech based on the strings that you send it. It can also store a number of predefined phrases onboard, so by sending the command to play the message in slot number three, your bot could say, for instance “Reached waypoint”. The SpeakJet chip would live on an external board, usually along with an amplifier and/or a speaker. Carrier boards are available for it, which make using a number of convenient features of the chip easy.
There are a number of “chipcorder” type solutions out there, where you would connect a microphone, send it some commands, and it records the audio input for later playback. Most of these solid-state recorders use non-volatile memory so they don’t lose their data when you cut the power to the module. In this case, your micro would send a command to, for instance, play message number two, and it would play back the audio that had been recorded into that message slot earlier. These are similar to the audio message reminders that you can get at electronics stores, but with an interface that’s a bit more elaborate than just “push button to play message”.
Both of these solutions use offboard components, and neither stores audio or numeric data within the atom itself. The only exception to that would be in the case of the SpeakJet, where if you didn’t want to use its pre-defined message slots, you could store a list of allophones to build messages in an EPROM, or directly coded into your program, and send them out via the serial line. for commonly-used strings, which might be fairly lengthy, programming them into the SpeakJet would be easier.
Do some googling out there on the web - you’ll be able to find examples of both of these modules, most likely with audio samples, so you get an idea of what they sound like.
sure, i just have one question though
would this work if i hooked up a microphone to p0
[code]
variables
goodby con p9
hello con p0
main
write 100,hello
pause 1000
read 100,goodby
goto main
[/code][/code]
I did some single bit sound way back when ram came in 4K chunks and I was amazed at how much fidelity could be captured. So yes i would think that hoooking up a microphone to a pin and recording some seconds, should also play back through the squeeker speeker. When I did it I recorded transitions from +v to -v and wrote a zero bit if there was no transition and a one bit if there was a transition. Playback was simple, generate a voltage if there is a 1bit and do nothing on zero bits. The “S” sound generated the most ones, , and the “ah” sounds more zeros. This is from so long ago I am sure my explanation is only 80% but if I remember more I will post it.
Taking a cue from another thread:
At the risk of sounding like a broken record (no pun intended):
To the best of my knowledge and experience, the Atom microcontroller is not capable of stand-alone speech synthesis.
To achieve this will require the addition of either a speech synthesizer, or some sort of record/playback module, as detailed above. The method that Pgmr refers to would likely require the addition of some sort of data storage beyond that available in the Atom - you would have to get details from him, as I am fairly vague on the details of the method he’s talking about.
ok, thank’s for the help
i think that i could use speakjet