mattvador / node-red-contrib-mic Goto Github PK
View Code? Open in Web Editor NEWNode-RED node for microphone
License: MIT License
Node-RED node for microphone
License: MIT License
I know this could be an huge request... but I think this is a great "enhancement" about the possibility to use this fantastic component!
Thank you.
Hello Guys,
I detected a bug which leads to a crash of node-red. Everytime I click on the start button of the mic-node or send a "start" as payload node-red crashes.
I installed sox and set it as env-variable. A colleague told me that he solved the problem with installing Sox but this works not for me.
Here are the logs of the crash:
23 Mar 12:01:14 - [info]
23 Mar 12:01:14 - [info] Node-RED version: v0.16.2
23 Mar 12:01:14 - [info] Node.js version: v6.10.0
23 Mar 12:01:14 - [info] Windows_NT 6.1.7601 x64 LE
23 Mar 12:01:16 - [info] Loading palette nodes
23 Mar 12:01:19 - [warn] ------------------------------------------------------
23 Mar 12:01:19 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
23 Mar 12:01:19 - [warn] [tail] Not currently supported on Windows.
23 Mar 12:01:19 - [warn] [microphone] Error: microphone already registered
23 Mar 12:01:19 - [warn] ------------------------------------------------------
23 Mar 12:01:19 - [info] Settings file : \Users\ASt.node-red\settings.js
23 Mar 12:01:19 - [info] User directory : \Users\AStr.node-red
23 Mar 12:01:19 - [info] Flows file : \Users\AStrang.node-red\anditest
23 Mar 12:01:19 - [info] Server now running at http://127.0.0.1:1880/
23 Mar 12:01:19 - [info] Starting flows
23 Mar 12:01:19 - [info] Started flows
23 Mar 12:01:27 - [info] [Mic:TestMic] Event input: start
23 Mar 12:01:27 - [info] [Mic:TestMic] Stream event startComplete
23 Mar 12:01:27 - [error] [wav-filewriter:test] No compatible status found in ms
gIn.
23 Mar 12:01:27 - [red] Uncaught Exception:
23 Mar 12:01:27 - Error: spawn rec ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Any ideas so far?
This node needs more documentation of the options that are provided in the node. The Node Help does not explain what ANY of the options are for.
The node appear to not work on Windows (see attached flow).
SOX is working: I'm able to record on the command line using the following command
rec test.wav
I'm also able to successfully record using the "working" flow provided. When I start it, it will produce a "test.wav" file that skip the initial silence and stop recording after 5 second of silence.
`rec test.wav silence 1 00:01 0.1% 1 00:05 0.1%"
However, when the same command (at least I think I set all the parameters in the correct way) is issued using your node, it will issue a "msg.payload: isSilence" and stops recording immediately.
[{"id":"1b84bae8.7c9985","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"cfb56183.362e38","type":"Mic","z":"1b84bae8.7c9985","name":"Record","outputPayloadType":"stream","endian":"little","bitwidth":"16","encoding":"signed-integer","channels":"1","device":"default","rate":"22050","silenceTimeout":"1 00:01 0.1% 1 00:05 0.1%","exitOnSilence":"true","debug":"false","active":true,"x":429,"y":131,"wires":[["8973ef57.0b587","113d012d.3d0ed7"]]},{"id":"113d012d.3d0ed7","type":"file","z":"1b84bae8.7c9985","name":"Output file","filename":"z:\libri\byosh\experiments\test.raw","appendNewline":false,"createDir":true,"overwriteFile":"true","x":650,"y":226,"wires":[]},{"id":"8973ef57.0b587","type":"debug","z":"1b84bae8.7c9985","name":"","active":true,"console":"false","complete":"payload","x":1077,"y":236,"wires":[]},{"id":"4028bd6e.c367cc","type":"trigger","z":"1b84bae8.7c9985","op1":"start","op2":"stop","op1type":"str","op2type":"str","duration":"10","extend":false,"units":"s","reset":"","name":"start-stop","x":195,"y":190,"wires":[["cfb56183.362e38"]]},{"id":"d69a816f.15cbc8","type":"inject","z":"1b84bae8.7c9985","name":"Start test","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":104,"y":61,"wires":[["4028bd6e.c367cc"]]},{"id":"99979c46.ae80f","type":"inject","z":"1b84bae8.7c9985","name":"Start","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":174,"y":407,"wires":[["1af7e417.7179d4"]]},{"id":"1af7e417.7179d4","type":"exec","z":"1b84bae8.7c9985","command":"rec z:\libri\byosh\experiments\test.wav silence 1 00:01 0.1% 1 00:05 0.1%","addpay":false,"append":"","useSpawn":"true","timer":"60","oldrc":false,"name":"Record","x":616,"y":410.5,"wires":[["8973ef57.0b587"],[],["8973ef57.0b587"]]},{"id":"1e850018.5360b8","type":"inject","z":"1b84bae8.7c9985","name":"Stop","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":172,"y":524,"wires":[["8ed69269.77669"]]},{"id":"8ed69269.77669","type":"change","z":"1b84bae8.7c9985","name":"","rules":[{"t":"set","p":"kill","pt":"msg","to":"SIGTERM","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":397,"y":530,"wires":[["1af7e417.7179d4"]]},{"id":"bfee75bf.9f0688","type":"comment","z":"1b84bae8.7c9985","name":"Not Working","info":"","x":89,"y":31,"wires":[]},{"id":"e3648c86.d8189","type":"comment","z":"1b84bae8.7c9985","name":"Working","info":"","x":151,"y":375,"wires":[]}]
-- flow ---
[{"id":"5bc85df0.cb7054","type":"Mic","z":"d2f2d81d.a7ac98","name":"麦克风","outputPayloadType":"stream","endian":"little","bitwidth":"16","encoding":"signed-integer","channels":"1","device":"plughw:1,0","rate":"22050","silenceTimeout":0,"exitOnSilence":false,"debug":false,"active":true,"x":595.5,"y":178,"wires":[["c53422cc.b2d75","87eda3ca.a0e5f"]]},{"id":"c53422cc.b2d75","type":"ui_audio","z":"d2f2d81d.a7ac98","name":"音频输出","group":"91445def.c9f6a","voice":"en-US","always":"","x":825.5,"y":168,"wires":[]},{"id":"87eda3ca.a0e5f","type":"debug","z":"d2f2d81d.a7ac98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":809.5,"y":258,"wires":[]},{"id":"d6a83a92.776ab8","type":"inject","z":"d2f2d81d.a7ac98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":388.5,"y":167,"wires":[["5bc85df0.cb7054"]]},{"id":"91445def.c9f6a","type":"ui_group","z":"","name":"Default","tab":"28405f75.1ff78","disp":true,"width":"6","collapse":false},{"id":"28405f75.1ff78","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]
---version ---
node red
0.18.6
node
root@ubuntu:~# node -v
v8.11.2
---- errors ----
30 May 20:38:29 - [info] Starting flows
30 May 20:38:29 - [info] Started flows
30 May 20:38:29 - [info] [Mic:麦克风] Event input: 1527683909861
30 May 20:38:29 - [info] [Mic:麦克风] Stream event startComplete
30 May 20:38:29 - [red] Uncaught Exception:
30 May 20:38:29 - Error: spawn arecord ENOENT
at _errnoException (util.js:992:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.