alphacep / vosk-android-demo

Offline speech recognition for Android with Vosk library.
Apache License 2.0
714 stars 187 forks source link

Can I get processed audio from the Recognizer? #16

Open chamecall opened 4 years ago

chamecall commented 4 years ago

I had to refuse android.SpeechRecognizer because of the impossibility to extract audio from it so I'd like to find out how I can reach that purpose in here..

nshmyrev commented 4 years ago

If you record audio yourself you can simply feed it into the recognizer, see https://github.com/alphacep/kaldi-android-demo/blob/83b23cfc34dde4b688fbfff7566a460bc9b56455/app/src/main/java/org/kaldi/demo/KaldiActivity.java#L132 method

abouquet commented 4 years ago

I guess he wants to do the opposite : extract recognized audio and process it for an other use case (like saving audio AND text together)

pristalovpavel commented 2 years ago

Are there any updates with this issue? Or maybe someone else added this function?

l3von commented 2 years ago

Are there any updates on this issue. Is it possible to get audio file from the default recognizer used by Vosk or no?

nanaghartey commented 2 years ago

Are there any updates on this issue. Is it possible to get audio file from the default recognizer used by Vosk or no?

Yes, it's possible. You can read in raw PCM data from android's AudioRecord and output it to a valid WAV file. You'd have to implement in SpeechService class and build..

4rzumanyan commented 2 years ago

Are there any updates on this issue. Is it possible to get audio file from the default recognizer used by Vosk or no?

Yes, it's possible. You can read in raw PCM data from android's AudioRecord and output it to a valid WAV file. You'd have to implement in SpeechService class and build..

Can you send example?

LevonArzumanyan commented 2 years ago

Did you create your own implementation of SpeechService? Because inside original implementation AudioRecord field is private.

nanaghartey commented 2 years ago

Did you create your own implementation of SpeechService? Because inside original implementation AudioRecord field is private.

Yes I did!

PavelPristalovArammeem commented 2 years ago

@nanaghartey could you share your fork please? I think the whole community will be grateful to you for this.