Hi Node Red Community,
i want to record audio using the MicroPi, because i need the raw data, with an USB mic.
The problem i have is that the files that are being saved are just empty shells with no contend.
I tried different images and different hardware but nothing seems to fix the problem.
The funny thing is that when i use the ui_microphone everything does work and the files are not empty.
Here is my flow:
Thank you.
Cheers
[{"id":"2035a9c9.624d36","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"32773959.5299b6","type":"inject","z":"2035a9c9.624d36","name":"record","repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"true","payloadType":"bool","x":550,"y":260,"wires":[[]]},{"id":"3753cc7d.db7f04","type":"inject","z":"2035a9c9.624d36","name":"stop","repeat":"","crontab":"","once":false,"topic":"","payload":"false","payloadType":"bool","x":550,"y":300,"wires":[[]]},{"id":"76f237f5.296d48","type":"debug","z":"2035a9c9.624d36","name":"Raw L16 Wave Stream","active":false,"console":"false","complete":"true","x":1150,"y":280,"wires":[]},{"id":"3adbc468.f9338c","type":"debug","z":"2035a9c9.624d36","name":"Wav File as a Buffer and metadata","active":true,"console":"false","complete":"true","x":1180,"y":320,"wires":[]},{"id":"2569e4d3.5af8bc","type":"debug","z":"2035a9c9.624d36","name":"Status Messages","active":false,"console":"false","complete":"true","x":1130,"y":360,"wires":[]},{"id":"c469bfb7.f2b7f","type":"comment","z":"2035a9c9.624d36","name":"MicroPi Node Pack - Demo Flow","info":"","x":610,"y":160,"wires":[]},{"id":"b3fc88a6.454a58","type":"comment","z":"2035a9c9.624d36","name":"Micropi","info":"","x":530,"y":220,"wires":[]},{"id":"1a2e1afe.2db8b5","type":"function","z":"2035a9c9.624d36","name":"","func":"date = Date.now();\n//day = date.prototype.getDate();\n//month = date.prototype.getMonth();\n//year = date.prototype.getFullYear();\n//hours = date.prototype.getHours();\n//min = date.prototype.getMinutes();\n//sec = date.prototype.getSeconds();\n\n//formated_date = year + month + day + \"_\" + hours + min + sec;\n\nmsg.filename = \"/home/pi/audio/charlotte_\" + date;\nreturn msg;","outputs":1,"noerr":0,"x":1160,"y":440,"wires":[["80c4f35e.a3b27"]]},{"id":"35f8c5f2.19dcfa","type":"file in","z":"2035a9c9.624d36","name":"","filename":"/home/pi/audio/demo.wav","format":"","chunk":false,"sendError":false,"encoding":"none","x":950,"y":460,"wires":[["1a2e1afe.2db8b5"]]},{"id":"80c4f35e.a3b27","type":"file","z":"2035a9c9.624d36","name":"","filename":"","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":1350,"y":440,"wires":[[]]},{"id":"d8fe772.5986d88","type":"fft","z":"2035a9c9.624d36","input":"payload","singleValue":true,"fields":"accelerometer_x,accelerometer_y,accelerometer_z","inputType":"msg","transformType":"real","out_prefix":"fft_","x":1170,"y":500,"wires":[["a97c9bce.9c7b28"]]},{"id":"e5bcbcd2.0a1ff","type":"ui_chart","z":"2035a9c9.624d36","name":"","group":"cd78e7e8.b58278","order":2,"width":13,"height":4,"label":"Akustik ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"20000","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"1","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1565,"y":216,"wires":[[]]},{"id":"6367d750.f44058","type":"ui_gauge","z":"2035a9c9.624d36","name":"","group":"b033e834.2f19b8","order":2,"width":0,"height":0,"gtype":"gage","title":"Akustik ","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1567.5,"y":167,"wires":[]},{"id":"67b3df52.fc98d","type":"ui_gauge","z":"2035a9c9.624d36","name":"","group":"b033e834.2f19b8","order":1,"width":0,"height":0,"gtype":"gage","title":"Vibration","label":"mm/s²","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1575,"y":307,"wires":[]},{"id":"78711767.564cc8","type":"ui_chart","z":"2035a9c9.624d36","name":"","group":"cd78e7e8.b58278","order":1,"width":13,"height":4,"label":"Vibration [mm/s²]","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"20000","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1604,"y":358,"wires":[[]]},{"id":"26a8afda.e6bfb","type":"ui_gauge","z":"2035a9c9.624d36","name":"","group":"b033e834.2f19b8","order":3,"width":0,"height":0,"gtype":"gage","title":"Strom","label":"A","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1568,"y":449,"wires":[]},{"id":"a97c9bce.9c7b28","type":"ui_chart","z":"2035a9c9.624d36","name":"","group":"cd78e7e8.b58278","order":3,"width":13,"height":4,"label":"Strom [A]","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"400","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1577,"y":500,"wires":[[]]},{"id":"143fadf4.d1ab22","type":"ui_switch","z":"2035a9c9.624d36","name":"","label":"STOP/START","tooltip":"","group":"e6b77531.995c88","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":696.5,"y":386,"wires":[["6ce71b32.c028e4"]]},{"id":"3d3700eb.93818","type":"file","z":"2035a9c9.624d36","name":"","filename":"/home/pi/audio/mictest","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1190,"y":560,"wires":[[]]},{"id":"46f8ff13.8f477","type":"debug","z":"2035a9c9.624d36","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":980,"y":640,"wires":[]},{"id":"6ce71b32.c028e4","type":"microPi","z":"2035a9c9.624d36","name":"microPi","filename":"/home/pi/audio/demo.wav","domain":"http://localhost:1880","rate":"16000","bitwidth":"16","endian":"little","encoding":"signed-integer","channels":"1","silence":"0","debug":true,"mode":"666","x":880,"y":320,"wires":[["76f237f5.296d48"],["3adbc468.f9338c","35f8c5f2.19dcfa","735fde7.d701a2"],["2569e4d3.5af8bc"]]},{"id":"3b87ad8a.0030c2","type":"microphone","z":"2035a9c9.624d36","name":"microphone","endian":"little","bitwidth":"16","encoding":"signed-integer","channels":"1","rate":"22050","silence":10,"debug":false,"active":true,"x":650,"y":580,"wires":[["46f8ff13.8f477","ee40cc40.820ec"]]},{"id":"ee40cc40.820ec","type":"wav-filewriter","z":"2035a9c9.624d36","name":"","path":"","mode":"700","x":920,"y":520,"wires":[["3d3700eb.93818"]]},{"id":"735fde7.d701a2","type":"wav-headers","z":"2035a9c9.624d36","name":"","action":"add","channels":1,"samplerate":22050,"bitwidth":16,"x":1040,"y":220,"wires":[[],[]]},{"id":"cd78e7e8.b58278","type":"ui_group","name":"DIAGRAMM","tab":"85d92fc7.b2c7f","order":2,"disp":true,"width":"13","collapse":false},{"id":"b033e834.2f19b8","type":"ui_group","name":"ANZEIGE","tab":"85d92fc7.b2c7f","order":1,"disp":true,"width":6,"collapse":false},{"id":"e6b77531.995c88","type":"ui_group","name":"Control","tab":"85d92fc7.b2c7f","order":3,"disp":true,"width":"6","collapse":false},{"id":"85d92fc7.b2c7f","type":"ui_tab","name":"BOEHLERIT GUI","icon":"dashboard","order":4,"disabled":false,"hidden":false}]