Closed wasweisic closed 3 years ago
Hi
reading your code excerpt, I notice you pass to transcript()
a buffer; that's wrong.
The first parameter of transcript()
if a fileName:
https://github.com/solyarisoftware/voskJs/blob/master/voskjs.js#L80
So if i understand you correctly I need to write my buffer stream to a "cache" .wav audio file. To transcribe it using voskJs. Context: I want to use voskjs as Speech to Text for a Discord/Chat bot. Therefore I don't know if that would cause more delay, especially for multiple Input in Realtime
well,
Yes, to use transcript() as is, you have to generate a wav file in the correct format, from your buffer data, and pass the filename as first parameter.
Or, you can modify transcript function to work with a buffer directly. Please note that buffer must be in the correct/required format (16K rate, mono, etc.) Tricky.
Qith current VoskJs version you can pass audio buffer (in PCM format) to the transcript function transcriptFromBuffer
:
https://github.com/solyarisoftware/voskJs/blob/master/voskjs.js#L204
A star on the project is welcome :)
Hey its me again im using voskJs and the german Model, but i think didn't get the Buffer format right. And sorry, I'm just at the beginning to understand js.
Console Output / ERROR
INPUT
VOSKjs function