-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to pass data to the KaldiRecognizer results in an odd internal error #72
Comments
Hey, Tim. What happens if you run the examples? Do you get the same error with their calls to acceptWaveform()? Just trying to narrow down the problem, e.g. maybe Vosk always barfs on 48k sample rate. Note I am not a maintainer. Just another vosk-browser user. |
there are rust bindings for vosk which would be a better choice for your rust application I guess. As for your issue, could you share which model you're using and what sampleRate you're passing as a param to the recognizer? |
@ccoreilly The Rust bindings are for a non-WASM context, though. Since I'm compiling the Rust project to WASM, the bindings wouldn't be particularly helpful, I believe. I'm dynamically checking for the sample rate provided by the user's media device (via the settings of the As for the models, I downloaded the models intended for mobile devices from this website, excluding those models that did not comply to the file structure specified in the lib README. The same error occured with the small models for German and English. |
I would assume there is an issue with the inputs you're passing to the acceptWaveform method. Could you share the snippet of code you use to record up to when you feed it to the recognizer? |
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 thatmodel.KaldiRecognizer()
requiressampleRate
as an argument by looking at the source code.I'm using the
AudioRecorder
web API to record aMediaStream
, converting that to aFloat32Array
and copying that array into anAudioBuffer
, which I then pass toacceptWaveform()
.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:, followed by another log of
undefined
.I'm not sure what this is about, honestly. Any pointers would be appreciated.
The text was updated successfully, but these errors were encountered: