Android speech recognizing and audio recording in the same time

后端 未结 5 1416
野趣味
野趣味 2020-12-02 17:21

My application records audio using MediaRecorder class in AsyncTask and also use Google API transform speech to text - Recognizer Intent - using the code from this question

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 17:52

    Recent projects on 'google-speech' and on 'android-opus' (opuslib) allow simple, concurrent recognition along with audio record to an opus file in android ext. storage.

    Looking at the VoiceRecorder in the speech project , with only a few extra lines of code after reading the microphone buffer, the buffer can also be consumed by a fileSink (PCM16 to Opus-codec) in addition to the current speech-observer.

    see minimal merge of the 2 projects above in Google-speech-opus-recorder

提交回复
热议问题