Hello guys, we can see talking doorbells, water tank indication bells and other similar talking children toys. So, today we will take a look into Text to speech converters. For the sake of simplicity, we are using Arduino UNO microcontroller as text to speech controller. Similar thing is possible in google, at the time of pronunciation of any word or sentence.

Basic mechanism:

The first step in TTS(Text to speech) is pre-processing or normalization. This step involves the conversion of the symbols, numbers and abbreviations into words that can be read by the machines like ‘?’ will be converted into “question mark”.

The second step involves the conversion of normalized text into phonemes or phonetic transcripts. The phonemes are the small parts of spoken words i.e. these are the sounds that make sentences. This step is really essential so that machine can speak the words as humans do.

The last step is the synthesis of phonemes into spoken voice. This step can be achieved by different methods like by recording the human voice for different words/phrases or by generating basic sound frequencies and pile them up as phonemes or by copying human speaking mechanism.

Components required:

1) Arduino UNO

2) Small Amplifier module

3) Speaker

4) Power supply

5) Connecting wires

Amplifier section:

Here you can use a separate amplifier module to do this or make one on breadboard/pcb using low power amplifier IC. I am using PAM8610 Class D module In my project. This can be operated on 9-12vots and can deliver an output of 15w.

In case you don’t have amplifier module, using above circuit you can make a small amplifier. This one have LM386 as amplifier ic, some coupling and filtering capacitors and resistors as other supported circuitry.

Connection with Arduino:

The output of text to speech convertor is taken from D3 pin of Arduino, mentioned as default output pin in the code library. So either you can put a small amplifier like PAM8610 or a DIY one.

Both the circuits are given here, You can supply Arduino and amplifier with help of 9volt battery. Don’t forget to add filter capacitor to audio output pin of Arduino.

Programming section:

The program for Text to speech converter is very easy, All the things, processing and delay is handled by the library named “talkie”. Download this library to your Arduino IDE, go to tools> manage libraries and then search for talkie.

Download and install the latest version of talkie from there. This library is very handy and it has over 1000 words and commands. It has several examples, you can try them all but here we are using a simple code to explain the working.

To use the more feature/ commands you can go to file location from This PC > documents > Arduino > Libraries > Talkie > src.

Code:

The coding is very simple, first include the libraries and header files. Here Vocab_US_LARGE.H is used for alerts like “danger” and Vocab_Special.h for giving exact pauses to speech.

The library support 1000 words, so you can get the supported words from the Arduino file location of talkie library as mentioned above.

#include "Talkie.h"
#include "Vocab_US_Large.h"
#include "Vocab_Special.h"

Talkie voice;

void setup() {
}
void loop() {
    voice.say(spPAUSE2);
    voice.say(sp2_THE);
    voice.say(sp2_TIME);
    voice.say(sp3_IS);
    voice.say(sp3_FIVE);
    voice.say(sp3_OCLOCK);  
}

Working:

Here is small example of working, I designed this circuit on breadboard. Working well and good output.

More info about Arduino:

If you want to make your own Arduino, like mine one. All the Gerber files with circuit details are here for you. PCBway is the only prototype PCB company offering a great PCB boards in lower prices and If you sign-up using this link you will get newcomer and sign-up coupon rewards.

Ordering process is quite simple, first select the parameters (length and width) of PCB. Then choose PCB material, color and thickness.

Save...

Read more »