vosk-android-demo icon indicating copy to clipboard operation
vosk-android-demo copied to clipboard

Can I get processed audio from the Recognizer?

Open chamecall opened this issue 4 years ago • 9 comments

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..

chamecall avatar Jan 04 '20 13:01 chamecall

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

nshmyrev avatar Jan 04 '20 18:01 nshmyrev

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)

abouquet avatar Apr 21 '20 10:04 abouquet

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

pristalovpavel avatar Apr 10 '22 18:04 pristalovpavel

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

l3von avatar Apr 25 '22 09:04 l3von

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..

nanaghartey avatar Apr 25 '22 13:04 nanaghartey

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?

4rzumanyan avatar Apr 29 '22 00:04 4rzumanyan

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

LevonArzumanyan avatar May 01 '22 10:05 LevonArzumanyan

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

Yes I did!

nanaghartey avatar May 01 '22 12:05 nanaghartey

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

PavelPristalovArammeem avatar May 02 '22 11:05 PavelPristalovArammeem