使用eSpeak文字转语音的应用引擎 [英] using eSpeak tts engine in application

查看:969
本文介绍了使用eSpeak文字转语音的应用引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的code为文本到语音在我的申请。

I have this code for text to speech in my application.

public void onInit(int status) {
    // TODO Auto-generated method stub
     if (status == TextToSpeech.SUCCESS) {
         //Setting speech language           
         int result = tts.setLanguage(Locale.ENGLISH);            
         //If your device doesn't support language you set above
         if (result == TextToSpeech.LANG_MISSING_DATA
                 || result == TextToSpeech.LANG_NOT_SUPPORTED) {
                //Cook simple toast message with message
                Toast.makeText(this, "Language not supported", Toast.LENGTH_LONG).show();
                //Log.e("TTS", "Language is not supported");
         }                 
         //TTS is not initialized properly
     } else {
                Toast.makeText(this, "TTS Initilization Failed", Toast.LENGTH_LONG).show();
                //Log.e("TTS", "Initilization Failed");
     }
}

我的应用程序包括像英语,印地文,马拉地语,泰卢固语,泰米尔语等多种不同的语言由于默认的Andr​​oid TTS引擎不支持这些语言,我从网上下载该eSpeak文字转语音引擎<一个href=\"https://play.google.com/store/apps/details?id=com.google$c$c.eyesfree.espeak&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5nb29nbGVjb2RlLmV5ZXNmcmVlLmVzcGVhayJd\"相对=nofollow>链接并安装它在我的手机上。

My application includes many different languages like English, Hindi, Marat Telugu, Tamil, etc. Since the default android tts engine does not support these languages, I downloaded eSpeak tts engine from this link and installed it on my phone.

它的默认语言设置为英文。如何更改其语言在我的code,以便它可以读取其他语言的UNI code文本呢?

Its default language is set as English. How do i change its language in my code so that it can read unicode texts of other languages as well?

目前,在印地文脚本一句话,它说一些数字。

Currently, for a word in hindi script, it speaks some numbers.

我如何让它识别文本中使用的语言?这表明仅在默认谷歌TTS可用的区域。我如何改变TTS引擎eSpeak文字转语音?

How do i make it recognise the language used in the text? It shows only the locales available in the default google tts. How do I change the tts engine to eSpeak tts?

推荐答案

使用初始化您的文字转语音

Initialize your TextToSpeech using

TextToSpeech (Context context, TextToSpeech.OnInitListener listener, String engine)

这是

tts = new TextToSpeech(this, this, "com.googlecode.eyesfree.espeak");

TTS引擎的引擎包名称来使用,你可以得到通过调用 getEngines

这篇关于使用eSpeak文字转语音的应用引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆