Gautam Mandsorwale
Gautam Mandsorwale

Reputation: 1600

text to speech functionality in android

Need help with text to speech functionality in android.. The per-requisite is u need to install the speech synthesis engine for your device, if there are no voice files installed.. my requirement is to handle that installation in the background without prompting users to install it manually by going to the android market, which is the general case right now..

For now what Im doing is placing the speech synthesis engine apk in the assets folder and trying to install it from there, but Im getting the "problem parsing package" error. Any directions that i can get??

Upvotes: 0

Views: 603

Answers (2)

gregm
gregm

Reputation: 12169

Maybe you could find a way to install the language data using this project: (which appears to be the same code that the official release uses)

http://code.google.com/p/eyes-free/downloads/detail?name=com.svox.langpack.installer_1.0.1.apk&can=2&q=

That said: I suggest that you do NOT try to hide the speech data installation.

In Android 4.2 the language data process does not require going to the market so perhaps your difficulty will go away.

The official Android way will probably be more up to date and have more languages.

Upvotes: 0

Gerhard
Gerhard

Reputation: 1362

Create

textToSpeech = new TextToSpeech(context, this); 

while implementing the OnInitListener interface. in the onInit method do the following:

public void onInit(int status)
{
    if (status == TextToSpeech.SUCCESS)
    {
    } else
    { // Initialization failed. Alert to the user
    }
}

You don't have to install anything yourself. If TTS isn't installed or you have several TTS systems on your phone an appropriate Activity is beeing started.

Upvotes: 1

Related Questions