0

i write this code:

Intent voiceSearchIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
voiceSearchIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
startActivityForResult(voiceSearchIntent, 1);

i want to detect the language of speeched sentence. But when i run the intent it listens only English(US) language:

RecognizerIntent

is possibile run the Intent in generic mode and retrieve the spoken sentence?

Thanks so much.

4

1 回答 1

2

不,这是不可能的。语音识别算法的设计方式仅适用于单一语言。

您必须自己创建语言检测解决方案,例如,您可以运行使用CMUSphinx创建的手工语音识别器,并将分类器应用于解码的音素序列以获取语言。有更高级的语言识别算法,请参阅初始链接的评论:

http://www.cslu.ogi.edu/HLTsurvey/ch8node9.html

这不是一件容易的事,而且绝对不强大。向用户显示可供选择的语言列表要容易得多。

于 2013-08-27T06:01:33.410 回答