DeepSpeech-examples icon indicating copy to clipboard operation
DeepSpeech-examples copied to clipboard

NodeJS Microphone VAD Streaming - cannot start server

Open asyrafzlkln96 opened this issue 4 years ago • 14 comments

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?

asyrafzlkln96 avatar Apr 21 '20 10:04 asyrafzlkln96

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 ?

lissyx avatar Apr 21 '20 10:04 lissyx

Yes, I have read. And have installed everything. It seems like it just loads the model and then nothing happens.

asyrafzlkln96 avatar Apr 22 '20 02:04 asyrafzlkln96

Yes, I have read. And have installed everything. It seems like it just loads the model and then nothing happens.

Have you tried speaking ?

lissyx avatar Apr 22 '20 06:04 lissyx

Yes, I have tried speaking. I already updated all packages.

asyrafzlkln96 avatar Apr 23 '20 02:04 asyrafzlkln96

same thing happens to me, nothing really happens after starting the script

Deryuu avatar Apr 30 '20 10:04 Deryuu

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)

GaurangTandon avatar May 27 '20 05:05 GaurangTandon

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

syed7x avatar Jun 10 '20 18:06 syed7x

Is there any fix to the code required? Or just doc? Please feel free to send PR against r0.8 / master.

lissyx avatar Aug 18 '20 11:08 lissyx

I had same problem, and @syed7x's advice helped me. I find helpful to add that information to readme or something.

makubo avatar Jan 13 '21 01:01 makubo

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.

lissyx avatar Jan 13 '21 07:01 lissyx

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.

nys99 avatar Feb 19 '21 23:02 nys99

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.

Patronics avatar Feb 21 '21 02:02 Patronics

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.

lissyx avatar Feb 21 '21 11:02 lissyx

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: image

cvrsarthak avatar Apr 12 '22 11:04 cvrsarthak