语音识别问题:NullPointerException [英] Speech Recognition problem : NullPointerException

查看:81
本文介绍了语音识别问题:NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我开发了一款以语音识别为主要功能的应用。当我尝试将应用程序部署到手机语言设置为非英语的设备上时,我遇到了一个问题(我认为这是因为该语言不支持语音识别)。
我在应用程序启动之前得到了NullPointerException,在我实例化SpeechRecognizerUI实例时。


为了清楚起见,我知道语音识别功能支持哪些语言和我我只想识别英语演讲,但我不想让人们更改手机语言设置,以便他们能够使用我的应用程序。我试过
以多种方式修复它(过去3天)所以任何帮助或解释都会很棒!


我将英语设置为默认应用程序语言,但它没有任何区别。只有将英语设置为手机语言才能正常工作(我相信它适用于任何支持语音识别的语言)。 


谢谢,


Djordje

解决方案

你能从异常中发布调用堆栈吗? / p>

仅供参考:如果你去设置 - >演讲你可以下载其他语言。



Hi,

I developed an app that has Speech Recognition as its main feature. I ran into a problem when I tried to deploy the app onto device that had phone language set to other than English (I believe that is because speech recognition isn't supported for that language). I got NullPointerException , before app even started, at the point where I instantiated SpeechRecognizerUI instance.

Just to be clear, I know which languages are supported with speech recognition feature and I want only to recognize English speech but I don't want to make people change the phone language settings just so they could be able to use my app. I've tried to fix it in many ways (for the past 3 days) so any help or explanation would be great!

I've set English to be default app language but it doesn't make any difference. It works fine only if English is set as phone language (and I believe it would for any of the languages that have support for speech recognition). 

Thanks,

Djordje

解决方案

Can you post the call stack from the exception?

FYI: If you go to Settings -> Speech you can download other languages.


这篇关于语音识别问题:NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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