Text To Speech in Raspberry Pi

Text-to-speech (TTS) is a type of speech synthesis application that is used to create a spoken sound version of the text in a computer document, such as a help file or a Web page. TTS can enable the reading of computer display information for the visually challenged person, or may simply be used to augment the reading of a text message.

Current TTS applications include voice-enabled e-mail and spoken prompts in voice response systems. TTS is often used with voice recognition programs.

Like other modules the process has got its own relevance on being interfaced with, where Raspberry Pi finds its own operations based on image processing schemes. So once image get converted to text and there by it could be converted from text to speech.Character recognition process ends with the conversion of text to speech and it could be applied at any where.

Made the headphone or speaker connected to the Raspberry pi as shown in the related figure.

The first thing to do is run :

and check snd_bcm2835 is listed. If it isn’t then run the following command :

If the module isn’t loaded automatically when you boot then you can force it to load by using the following process :

Then add ‘snd-bcm2835′ so it looks like this :

By default the output is set to automatically select the default audio interface (HDMI if available otherwise analog). You can force it to use a specific interface using :

Where <n> is the required interface : 0=auto, 1=analog, 2=hdmi. To force the Raspberry Pi to use the analog output :

To check the sound, download an audio file by entering this command;

Play the audio file using;

 If the sound play in correct manner you can confirm that the analog output works properly.

By default the volume will be very less and to increase it, open the terminal and type the command and a new window will appear;

Increase the volume option by pressing the up arrow and make it to the maximum.Exit from the option and play the sound again and feel the difference.

The next process is to perform text to speech conversion. For that espeak module should be installed which is well suited for this purpose.

After the installation check it by entering the command in the prompt:

 To perform text to speech conversion using python write the code shown below on a python editor;

 Check the process with different texts and apply it on the suitable applications.

Shop With Us

  • Click here to buy Raspberry Pi 2 from RhydoLabz.
  • Click here to buy Raspberry Pi 2 Starter Kit from RhydoLabz.
  • Click here to buy Raspberry Accessories from RhydoLabz.


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">