The author of Instructables under the nickname Utsource tells how to use the Talkie library, which allows you to synthesize speech with Arduino. This is not a speech synthesizer that you may use on your smartphone, tablet or PC, and which can voice any text. The set of words here is fixed, but there are more than a thousand of them (this is in total, several connected dictionaries are provided). This library implements a software synthesis algorithm, implemented at one time in hardware in TI chips.
Talkie library lies here, it can also be downloaded through the library manager by entering its name in the search bar. The wizard shows this in the screenshot:
The library does not require the expansion of RAM, ROM, the addition of any hardware synthesizers. The speech synthesis is fully programmatic, an audio signal is output using PWM to output 3. There you can simply connect a dynamic head through a resistor, or you can use an additional amplifier. In the second case, the low-pass filter between the Arduino and the amplifier is desirable, but the master does without it. With a powerful amplifier, the low-pass filter becomes mandatory. The amplifier can be performed on any element base, the master selects the LM386 chip. He takes the switching circuit as standard, it is clear that the microphone and load resistor shown on it will not be needed for him - the signal source will be Arduino.
He models this circuit in the Fritzing program:
And it builds on a breadboard like breadboard:
To test the library in action, the wizard opens the sketch editor in the Arduino IDE:
And he dials this code:
#include "Talkie.h" //Talkie.h is used to initialize this library and set the Digital pin 3 of Arduino as output pin
#include "Vocab_US_Large.h" //Vocab_US_Large.h is used to use the alerts
#include "Vocab_Special.h" //Vocab_Special.h is used to use the pause
Talkie voice // define an object ‘value’ to use the commands
void setup () {
}
void loop () {
voice.say (spPAUSE2);
voice.say (sp2_DANGER);
voice.say (sp2_DANGER);
voice.say (sp3_STORM);
voice.say (sp3_IN);
voice.say (sp3_THE);
voice.say (sp3_NORTH);
/ * The first command voice.say (spPAUSE2) is to take a short pause while repeating the alert message. And the next commands are just simple words that imply: DANGER DANGER STORM IN THE NORTH. * /
}
The program connects a previously installed Talkie library and two dictionaries, one of which is needed to get a pause between words. This speech synthesizer does not understand any punctuation marks, nor abbreviations like PST and PST. When the program starts, he will utter monotonously the phrase "danger, danger, storm from the north side."
The library is suitable for arduino users who do not want to purchase rather expensive displays. Having occupied with the dynamic head, without or with an amplifier, only one “leg”, it is possible to realize the output in the form of speech of rather long phrases, and if you take a few more “legs” with the buttons, then the menu, including multi-level.