Android - 语音识别

时间:2015-10-06 01:29:27

标签: android voice-recognition

我正在寻找适用于Android的语音识别库。我只需要它来理解“是/否”答案(用不同的语言 - 如英语,德语,法语)。

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

不确定V-R库,因为Play商店最大应用程序大小为50美分,而这些语音包大约为15到20兆,因此无法将多种语言直接包含在应用程序中。

可能有一个在线服务可供使用,但您需要在网上搜索。

大多数人使用的是内置的Android语音识别Intent。对于不同的语言,对于您想要的语言应该是可以的,因为它们包含在内。但是,我不确定例如在法国,当您购买手机或平板电脑时,默认的VR语言将是法语而非英语,因此用户需要进入语言设置并下载法语VR包。 / p>

要在Android中启动V-R,请执行

    startVoiceRecognitionActivity();

       private void startVoiceRecognitionActivity() {
            Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);

            intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());

            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);

            intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);

            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en-US");

            startActivityForResult(intent, 1234);
        }

//To get the Voice data back as Text string

   @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == Activity.RESULT_OK) {
            //pull all of the matches
            ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

            String topResult = matches.get(0);

}};

String topResult是文字中的演讲

相关问题