vosk-api
vosk-api copied to clipboard
Converting audio with java
Good day, I've been trying all day to convert audio so that Vosk can work with it. The default audio format I get (from Discord) is the following:
I want to convert this to Vosk format, but unfortunately I don't know exactly how. Can anyone help me? Best would be a code snippet, I have to admit that audio processing is not my thing :/
AudioFormat OUTPUT_FORMAT = new AudioFormat(48000.0F, 16, 2, true, true);
Here is also my code: https://just-paste.it/FB0TyErtQP
Kind regards Nicklas
It has to be 1 instead of 2 (mono, not stereo).
It has to be 1 instead of 2 (mono, not stereo).
Hey, this is the audio fomat of discord, do you know how I can covert it?
Something like
https://stackoverflow.com/a/50657152
I modified my source code, but it still not works: https://just-paste.it/0O65WQXkAB
AudioFormat OUTPUT_FORMAT = new AudioFormat(48000.0F, 16, 2, true, true);
should be probably true, false
since the data is usually little endian.
AudioFormat OUTPUT_FORMAT = new AudioFormat(48000.0F, 16, 2, true, true);
is the audio format from discord, this is not my audio format. I get the data in this format.
AudioFormat OUTPUT_FORMAT = new AudioFormat(48000.0F, 16, 2, true, true);
should be probablytrue, false
since the data is usually little endian.
Hello, I guess I have to apologize, I did not read correctly. I have now adjusted the value, the speech recognition now works without problems. Nevertheless, a new problem occurs, namely, it does not recognize getResult, but getPartialResult does. Normally it should end after a sentence, no matter how long I wait, it does not output a getResult and hangs everything on each other. Maybe you can help me further.
Here is also my curent source code: https://just-paste.it/R0VJTcJlcO
You need to dump bytes you feed to recognizer and share the result.