DeepSpeech-examples
DeepSpeech-examples copied to clipboard
NodeJS Microphone VAD Streaming - cannot start server
Hi. After I run node start.js , nothing happened. Do i need to specify to specific port first? If so, can I use socketio protocol, to send the transcribed text over to client?
Hi. After I run node start.js , nothing happened. Do i need to specify to specific port first? If so, can I use socketio protocol, to send the transcribed text over to client?
Have you read the README and the code ?
Yes, I have read. And have installed everything. It seems like it just loads the model and then nothing happens.
Yes, I have read. And have installed everything. It seems like it just loads the model and then nothing happens.
Have you tried speaking ?
Yes, I have tried speaking. I already updated all packages.
same thing happens to me, nothing really happens after starting the script
The issue still exists. I am on Ubuntu 18.04 and r0.7 branch. Installed the npm modules and the language models (pbmm and scorer). Running node starts.js
just prints this:
TensorFlow: v1.15.0-24-gceb46aa
DeepSpeech: v0.7.1-0-g2e9c281
2020-05-27 10:42:36.617133: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
and exits with exit code zero. I checked the JS file, it goes all the way to around line 220 with microphone.start()
, but nothing happens after that. Ideally, I'd expect the process to not exit until Ctrl-C is pressed, and keep transcribing speech until that (like the python mic vad streaming example does)
The issue is with the npm 'mic' module, it sets a default device which most probably doesn't exist or is not default on your device. This mic configuration worked for me:
var microphone = mic({
rate: '16000',
channels: '1',
debug: true,
device: 'plughw:0,0',
fileType: 'wav'
});
Notice I set the debug mode to true and device to 'plughw:0,0' which is the default on my machine. You can find your default device using the terminal:
arecord -l
output:
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC293 Analog [ALC293 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
The default for 'mic' module is plughw:0,1
Is there any fix to the code required? Or just doc? Please feel free to send PR against r0.8 / master.
I had same problem, and @syed7x's advice helped me. I find helpful to add that information to readme or something.
I had same problem, and @syed7x's advice helped me. I find helpful to add that information to readme or something.
My previous answer still applies.
I was unable to get this to work on ubuntu 20.04 even with @syed7x fix. I had to run on MacOS to get it to work.
I can confirm that the fix from @syed7x worked great for me, also using "plughw:0,0".
@lissyx I think a modification of both the documentation and code would be ideal, as it seems most of us do need to change it to 0,0, but, on systems with multiple microphones (or other audio inputs), it may need to be manually modified.
I can confirm that the fix from @syed7x worked great for me, also using "plughw:0,0".
@lissyx I think a modification of both the documentation and code would be ideal, as it seems most of us do need to change it to 0,0, but, on systems with multiple microphones (or other audio inputs), it may need to be manually modified.
As i said earlier, happy to review a PR improving that.
Hi guys,
I tried to run the code and the code ran without any error. However, I am not able to get any output from it. Server.js runs fine and yarn start also starts the server. Deepspeech web page gets initiated with 2 buttons (Start recording and stop recording). In the background microphone also gets activated but I don't get the output displayed.
Here is the screenshot: