Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我需要实现一个可以读取葡萄牙语文本的应用程序(TTS).不幸的是,当使用TextToSpeech.setLanguage(Localeloc)方法时,我在其中找不到葡萄牙语.语言环境.返回的语言数量(葡萄牙语除外).那么,有什么方法可以用葡萄牙语实施TTS?无论如何,我正在使用Android2.3.3.更新一位成员建议,我

我需要实现一个可以读取葡萄牙语文本的应用程序(TTS).不幸的是,当使用TextToSpeech.setLanguage(Locale loc)方法时,我在其中找不到葡萄牙语.语言环境.返回的语言数量(葡萄牙语除外).

那么,有什么方法可以用葡萄牙语实施TTS?无论如何,我正在使用Android 2.3.3.

更新

一位成员建议,我使用了API

这是代码

private voID speak()    {        String text = textToSpeech.getText().toString();        Audio audio = Audio.getInstance();        inputStream sound;        try {            sound = audio.getAudio(text, Language.PORTUGUESE);            audio.play(sound);        } catch (Exception e) {            // Todo auto-generated catch block            e.printstacktrace();        }

我得到了错误

08-23 15:00:47.421: W/System.err(728): java.net.UnkNownHostException: translate.Google.com08-23 15:00:47.421: W/System.err(728):  at java.net.InetAddress.lookupHostByname(InetAddress.java:506)08-23 15:00:47.431: W/System.err(728):  at java.net.InetAddress.getAllBynameImpl(InetAddress.java:294)08-23 15:00:47.431: W/System.err(728):  at java.net.InetAddress.getAllByname(InetAddress.java:256)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnection.<init>(httpconnection.java:69)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnection.<init>(httpconnection.java:48)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnection$Address.connect(httpconnection.java:322)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnectionPool.get(httpconnectionPool.java:89)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.gethttpconnection(httpURLConnectionImpl.java:285)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.makeConnection(httpURLConnectionImpl.java:267)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.retrIEveResponse(httpURLConnectionImpl.java:1018)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.getinputStream(httpURLConnectionImpl.java:512)08-23 15:00:47.441: W/System.err(728):  at com.gtranslate.Audio.getAudio(Audio.java:34)08-23 15:00:47.451: W/System.err(728):  at com.example.tts.MainActivity.speak(MainActivity.java:70)08-23 15:00:47.451: W/System.err(728):  at com.example.tts.MainActivity.accessAudio audio = Audio.getInstance();inputStream sound  = audio.getAudio("portuguese sentence", Language.PORTUGUESE);audio.play(sound);(MainActivity.java:63)08-23 15:00:47.461: W/System.err(728):  at com.example.tts.MainActivity$SpeechClass.onClick(MainActivity.java:53)08-23 15:00:47.461: W/System.err(728):  at androID.vIEw.VIEw.performClick(VIEw.java:2485)08-23 15:00:47.461: W/System.err(728):  at androID.vIEw.VIEw$PerformClick.run(VIEw.java:9080)08-23 15:00:47.461: W/System.err(728):  at androID.os.Handler.handleCallback(Handler.java:587)08-23 15:00:47.461: W/System.err(728):  at androID.os.Handler.dispatchMessage(Handler.java:92)08-23 15:00:47.461: W/System.err(728):  at androID.os.Looper.loop(Looper.java:123)08-23 15:00:47.471: W/System.err(728):  at androID.app.ActivityThread.main(ActivityThread.java:3683)08-23 15:00:47.471: W/System.err(728):  at java.lang.reflect.Method.invokeNative(Native Method)08-23 15:00:47.471: W/System.err(728):  at java.lang.reflect.Method.invoke(Method.java:507)08-23 15:00:47.471: W/System.err(728):  at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)08-23 15:00:47.471: W/System.err(728):  at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:597)08-23 15:00:47.471: W/System.err(728):  at dalvik.system.NativeStart.main(Native Method)

解决方法:

java-google-translate-text-to-speech怎么样?它是Google Translate的API,它公开了“文字朗读”功能.它支持Portuguese,并且这样的代码段应该可以完成工作:

[+++]

缺点是您必须在线才能使用该API.

总结

以上是内存溢出为你收集整理的Java-文字转语音:葡萄牙语不可用?全部内容,希望文章能够帮你解决Java-文字转语音:葡萄牙语不可用?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Java-文字转语音:葡萄牙语不可用?_app_内存溢出

Java-文字转语音:葡萄牙语不可用?

Java-文字转语音:葡萄牙语不可用?,第1张

概述我需要实现一个可以读取葡萄牙语文本的应用程序(TTS).不幸的是,当使用TextToSpeech.setLanguage(Localeloc)方法时,我在其中找不到葡萄牙语.语言环境.返回的语言数量(葡萄牙语除外).那么,有什么方法可以用葡萄牙语实施TTS?无论如何,我正在使用Android2.3.3.更新一位成员建议,我

我需要实现一个可以读取葡萄牙语文本的应用程序(TTS).不幸的是,当使用TextToSpeech.setLanguage(Locale loc)方法时,我在其中找不到葡萄牙语.语言环境.返回的语言数量(葡萄牙语除外).

那么,有什么方法可以用葡萄牙语实施TTS?无论如何,我正在使用Android 2.3.3.

更新

一位成员建议,我使用了API

这是代码

private voID speak()    {        String text = textToSpeech.getText().toString();        Audio audio = Audio.getInstance();        inputStream sound;        try {            sound = audio.getAudio(text, Language.PORTUGUESE);            audio.play(sound);        } catch (Exception e) {            // Todo auto-generated catch block            e.printstacktrace();        }

我得到了错误

08-23 15:00:47.421: W/System.err(728): java.net.UnkNownHostException: translate.Google.com08-23 15:00:47.421: W/System.err(728):  at java.net.InetAddress.lookupHostByname(InetAddress.java:506)08-23 15:00:47.431: W/System.err(728):  at java.net.InetAddress.getAllBynameImpl(InetAddress.java:294)08-23 15:00:47.431: W/System.err(728):  at java.net.InetAddress.getAllByname(InetAddress.java:256)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnection.<init>(httpconnection.java:69)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnection.<init>(httpconnection.java:48)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnection$Address.connect(httpconnection.java:322)08-23 15:00:47.431: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpconnectionPool.get(httpconnectionPool.java:89)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.gethttpconnection(httpURLConnectionImpl.java:285)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.makeConnection(httpURLConnectionImpl.java:267)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.retrIEveResponse(httpURLConnectionImpl.java:1018)08-23 15:00:47.441: W/System.err(728):  at org.apache.harmony.luni.internal.net.www.protocol.http.httpURLConnectionImpl.getinputStream(httpURLConnectionImpl.java:512)08-23 15:00:47.441: W/System.err(728):  at com.gtranslate.Audio.getAudio(Audio.java:34)08-23 15:00:47.451: W/System.err(728):  at com.example.tts.MainActivity.speak(MainActivity.java:70)08-23 15:00:47.451: W/System.err(728):  at com.example.tts.MainActivity.accessAudio audio = Audio.getInstance();inputStream sound  = audio.getAudio("portuguese sentence", Language.PORTUGUESE);audio.play(sound);(MainActivity.java:63)08-23 15:00:47.461: W/System.err(728):  at com.example.tts.MainActivity$SpeechClass.onClick(MainActivity.java:53)08-23 15:00:47.461: W/System.err(728):  at androID.vIEw.VIEw.performClick(VIEw.java:2485)08-23 15:00:47.461: W/System.err(728):  at androID.vIEw.VIEw$PerformClick.run(VIEw.java:9080)08-23 15:00:47.461: W/System.err(728):  at androID.os.Handler.handleCallback(Handler.java:587)08-23 15:00:47.461: W/System.err(728):  at androID.os.Handler.dispatchMessage(Handler.java:92)08-23 15:00:47.461: W/System.err(728):  at androID.os.Looper.loop(Looper.java:123)08-23 15:00:47.471: W/System.err(728):  at androID.app.ActivityThread.main(ActivityThread.java:3683)08-23 15:00:47.471: W/System.err(728):  at java.lang.reflect.Method.invokeNative(Native Method)08-23 15:00:47.471: W/System.err(728):  at java.lang.reflect.Method.invoke(Method.java:507)08-23 15:00:47.471: W/System.err(728):  at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)08-23 15:00:47.471: W/System.err(728):  at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:597)08-23 15:00:47.471: W/System.err(728):  at dalvik.system.NativeStart.main(Native Method)

解决方法:

java-google-translate-text-to-speech怎么样?它是Google Translate的API,它公开了“文字朗读”功能.它支持Portuguese,并且这样的代码段应该可以完成工作:

缺点是您必须在线才能使用该API.

总结

以上是内存溢出为你收集整理的Java-文字转语音:葡萄牙语不可用?全部内容,希望文章能够帮你解决Java-文字转语音:葡萄牙语不可用?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1087607.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存