vosk-browser
vosk-browser copied to clipboard
Attempting to pass data to the KaldiRecognizer results in an odd internal error
I'm trying to integrate vosk-browser
into my Rust-based WASM project.
First of, I'd like to note that the API documentation linked in the README
could be more precise: I only learned that model.KaldiRecognizer()
requires sampleRate
as an argument by looking at the source code.
I'm using the AudioRecorder
web API to record a MediaStream
, converting that to a Float32Array
and copying that array into an AudioBuffer
, which I then pass to acceptWaveform()
.
Apparently, the microphone records at a rate of 48 kHz, which seems reasonable to me. But when I actually pass the data to acceptWaveform()
, I receive the following error:
ASSERTION_FAILED (VoskAPI:Compute():mel-computations.cc:242) Assertion failed: (!KALDI_ISNAN((*mel_energies_out)(i)))
, followed by another log of undefined
.
I'm not sure what this is about, honestly. Any pointers would be appreciated.