Page 1 of 1
How to use built-in mic from camera as sound sensor?
Posted: Thursday 26 November 2015 22:27
by dutchnld
Hi All,
In the wiki with url
https://www.domoticz.com/wiki/MQTT I found the sound sensor section.
I do have a working Audio stream from my foscam camera in VLC.
But I get stuck with the wiki instructions.
"Assuming you have node and npm installed, all you need to do is run: sudo npm install -g domoticz-sound-detection"
Could anyone tell me what '
node' and '
nmp' is?
Thanks!
What is Node & NMP for making a sound sensor?
Re: How to use built-in mic from camera as sound sensor?
Posted: Friday 27 November 2015 12:27
by pj-r
NPM - package manager for Node.js
NODE - Amateur Packet Radio Node program
So with this command
sudo npm install -g domoticz-sound-detection
you install domoticz-sound-detection package to nodejs server?
Re: How to use built-in mic from camera as sound sensor?
Posted: Friday 27 November 2015 15:30
by dutchnld
hi,
thanks for your reply, but I'm still not sure what to do yet.
I want to execute 'sudo npm install -g domoticz-sound-detection' on the rpi running domoticz, but first I need NMP and NODE.
But how do I install that?
Re: How to use built-in mic from camera as sound sensor?
Posted: Monday 30 November 2015 11:20
by pj-r
This might work:
It depends what distro you have on rpi.
Re: How to use built-in mic from camera as sound sensor?
Posted: Monday 30 November 2015 13:19
by dutchnld
Hi Pj-r,
i'm using the standard domoticz raspberry pi image, so that's 'wheezy' right?
I Get the following message when I execute it:
Seems it's installed by default.
pi@domoticzpi ~ $ sudo apt-get install npm node
Reading package lists... Done
Building dependency tree
Reading state information... Done
node is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
npm : Depends: nodejs (>= 0.6.19~dfsg1-3) but it is not going to be installed
Depends: nodejs-dev
Depends: node-request but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-abbrev but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-fstream but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
pi@domoticzpi ~ $
I guess I could continue now.
Re: How to use built-in mic from camera as sound sensor?
Posted: Thursday 03 December 2015 21:59
by pj-r
I think you have to add some repository to apt where you can get older npm package or newer nodejs. Looks like in te repositories you have the nodejs package is too old and cannot be installed with the npm found from there.
Re: How to use built-in mic from camera as sound sensor?
Posted: Thursday 01 December 2016 22:11
by dutchnld
Hi Guys, one year later.... I still have this wish.
I am using a USB Logitech c920 HD Pro Camera. Accessing the camera stream within Domoticz is no problem.
This time I got a little further w/ the sound detection fortunately!
The repo's are installed. but when I run the command i get this error:
pi@domoticzpi ~ $
sudo domoticz-sound-detection -u http://localhost/audio.cgi -i 433
buffer.js:494
throw new RangeError('index out of range');
^
RangeError: index out of range
at checkOffset (buffer.js:494:11)
at Buffer.readInt16LE (buffer.js:629:5)
at null._decoder (/usr/local/lib/node_modules/domoticz-sound-detection/node_modules/sound-detection/node_modules/pcm-boilerplate/lib/utils.js:89:38)
at _.extend.read (/usr/local/lib/node_modules/domoticz-sound-detection/node_modules/sound-detection/node_modules/pcm-boilerplate/lib/utils.js:34:33)
at processBlock (/usr/local/lib/node_modules/domoticz-sound-detection/node_modules/sound-detection/index.js:16:35)
at emit (events.js:104:17)
at emitReadable_ (_stream_readable.js:424:10)
at emitReadable (_stream_readable.js:418:7)
at readableAddChunk (_stream_readable.js:174:11)
at Readable.push (_stream_readable.js:126:10)
pi@domoticzpi ~ $
Re: How to use built-in mic from camera as sound sensor?
Posted: Wednesday 28 November 2018 22:02
by quack3d
Did you get this working? I get the same error but my camera doesn't have a separate audio stream so I tried with the video stream.
Re: How to use built-in mic from camera as sound sensor?
Posted: Thursday 29 November 2018 6:00
by Ittiz
My house is crawling with foscams. I wanted to use them as the ears and mouths of my digital assistant. I found it doesn't work well. I did some tests and got the digital assistant listening through them but the the output was beyond what I could do. The biggest issue was the delay, the cameras have a considerable delay in transmitting the audio. Also the quality of the audio is fairly low making the speech recognition difficult. In the end found it was easier to repurpose my old defunct coax network for speakers and mics than to program a work around for my foscams.