Wednesday 29 June 2016

Hindi Text to Speech conversion using festival

Festival is a general multi-lingual speech synthesis system. It can be used for conversion of text to speech. In this article we will discuss how to use festival for conversion of hindi text to speech.

Installing Festival tool for Hindi :

Enter the following command in terminal :

sudo apt-get install festival-hi
This will also install the main festival packages automatically along with the hindi support.
  
Converting English Text to speech using Festival :

To read out English text "Hello" to speech, open the festival interface enter the command (SayText "<text>") to read out the text :
festival
(SayText "Hello")
Or you can also hear the text directly from command-line as :
echo "Hello" | festival --tts
You will hear the "Hello" from your speakers.

You can read out English text from any file using the command:
festival --tts input.txt
Or go inside festival and then read out the file as :
festival
(tts "input.txt")

Converting Hindi Text to speech using Festival :

To read out Hindi text "नमस्ते" to speech, open the festival interface, change the voice and then enter the command to read out the text :
festival
Then inside festival :
(voice_hindi_NSK_diphone)
(SayText "नमस्ते")
To view what all voices you can use enter the command :
(voice.list)
And for selecting any voice use :
(voice_<voice name>)
But what if you need to read out Hindi from a file using some shell script. You will need command-line to read Hind. Festival itself provides the command text2wave to do this.
text2wave -o outputHindi.wav inputHindi.txt -eval "(voice_hindi_NSK_diphone)"
This will read the Hindi text from the file inputHindi.txt and store the output audio in the file outputHindi.wav.

1 comment:

  1. Hello sir,I have read your blog about hindi voice to text I'm impressed that you have written such an amazing blog about hindi text to speech its a very nice way to aware people about things which we need to publish well Here i am share my Android Application where you can easily make your default speech to text this Hindi voice to text keyboard is very help you can try! Download this Hindi speech to text keyboard

    ReplyDelete