How to use Androids' speech to text with audio sample file

三世轮回 提交于 2020-01-09 11:06:53

问题


I was able to run an example project which uses Android speech to text using this code:

   private void startVoiceRecognitionActivity()
    {
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Voice recognition Demo...");
        startActivityForResult(intent, REQUEST_CODE);
    }

This works fine, but I was wondering, is it possible to use speech to text with an audio sample (byte array?) instead of recorded voice?

kind regards


回答1:


Currently Android only supports RecognizerIntent

Have a look at all these questions...

Speech recognition for recorded audio files in .3gp or wav format

Speech to Text from own sound file

Saving audio input of Android Stock speech recognition engine

Voice recognition on android with recorded sound clip?



来源:https://stackoverflow.com/questions/18849379/how-to-use-androids-speech-to-text-with-audio-sample-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!