How to use built-in mic from camera as sound sensor?

Post Reply
dutchnld
Posts: 26
Joined: Friday 23 October 2015 22:18
Target OS: Raspberry Pi
Domoticz version: 3.5974
Location: Amsterdam, Netherlands
Contact:

How to use built-in mic from camera as sound sensor?

Post by dutchnld » Thursday 26 November 2015 23:27

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?
-----
Raspberry Pi Model 2 B w/ Domoticz 3.5974 + Monit + Pi-Hole + RaZberry Z-wave module + RFXcom 433 USB

pj-r
Posts: 256
Joined: Wednesday 17 December 2014 18:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by pj-r » Friday 27 November 2015 13:27

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?
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors

dutchnld
Posts: 26
Joined: Friday 23 October 2015 22:18
Target OS: Raspberry Pi
Domoticz version: 3.5974
Location: Amsterdam, Netherlands
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by dutchnld » Friday 27 November 2015 16:30

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?
-----
Raspberry Pi Model 2 B w/ Domoticz 3.5974 + Monit + Pi-Hole + RaZberry Z-wave module + RFXcom 433 USB

pj-r
Posts: 256
Joined: Wednesday 17 December 2014 18:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by pj-r » Monday 30 November 2015 12:20

This might work:

Code: Select all

sudo apt-get install npm node
It depends what distro you have on rpi.
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors

dutchnld
Posts: 26
Joined: Friday 23 October 2015 22:18
Target OS: Raspberry Pi
Domoticz version: 3.5974
Location: Amsterdam, Netherlands
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by dutchnld » Monday 30 November 2015 14:19

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.
-----
Raspberry Pi Model 2 B w/ Domoticz 3.5974 + Monit + Pi-Hole + RaZberry Z-wave module + RFXcom 433 USB

pj-r
Posts: 256
Joined: Wednesday 17 December 2014 18:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by pj-r » Thursday 03 December 2015 22:59

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.
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors

dutchnld
Posts: 26
Joined: Friday 23 October 2015 22:18
Target OS: Raspberry Pi
Domoticz version: 3.5974
Location: Amsterdam, Netherlands
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by dutchnld » Thursday 01 December 2016 23:11

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 ~ $
-----
Raspberry Pi Model 2 B w/ Domoticz 3.5974 + Monit + Pi-Hole + RaZberry Z-wave module + RFXcom 433 USB

quack3d
Posts: 98
Joined: Sunday 26 March 2017 17:03
Target OS: -
Domoticz version:
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by quack3d » Wednesday 28 November 2018 23:02

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.

Ittiz
Posts: 37
Joined: Tuesday 03 January 2017 1:37
Target OS: Linux
Domoticz version:
Contact:

Re: How to use built-in mic from camera as sound sensor?

Post by Ittiz » Thursday 29 November 2018 7:00

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests