# rec -t raw test.raw remix - trim 0 10
trim 0 10
record 10 seconds
Test it at client pc:
# play -r 48000 -c 1 -b 16 -e signed-integer test.raw
Create profile file:
# sox -r 48000 -c 1 -b 16 -e signed-integer test.raw -n trim 0 2 noiseprof raw-profile
Record with noise canceld
# rec -t raw - remix - noisered raw-profile 0.2 | sox -t raw -r 48000 -c 1 -b 16 -e signed-integer - -t mp3 -c 1
-C 32 test.mp3
Play with the factor of 0.2 to regulate the intensity of cancellation.
D. Record 24/7
My goal of this....
Create a script:
# nano /root/record.sh
Insert the following:
#!/bin/bash
# send sigterm and wait for exit of the process
function stop() { kill $@; while kill -0 $@; do sleep 1; done; }
function log() { echo $(date +%T) $@; }
log "Stopping previus recording"
stop `pidof rec` &> /dev/null
DATE=`date "+%Y.%m.%d"`
log "Recording $DATE.mp3"
rec -q -t raw - remix - noisered /root/raw-profile 0.2 | \
sox -v 2.0 -t raw -r 48000 -c 1 -b 16 -e signed-integer - \
-t mp3 -r 22050 -c 1 -C -9.2 /root/$DATE.mp3
log "Done $DATE.mp3"
Recording:
-q
less output
Encoding: -v 2.0
Make the input stream louder
-r 22050
encode to a lower sample rate
-C -9.2
Create a low quality VBR mp3
Fileszie ~100mb per day. If you want smaller files, a 8000 sanple rate gives you a gsm grade quality.
A very good article to sample rate:
http://wiki.audacityteam.org/wiki/Sample_Rates
Make it executable
BPI-R1 MIC
24
Summary of Contents for BPI-R1
Page 5: ...BPI R1 hardware interface BPI R1 hardware interface Front Back BPI R1 hardware interface 5...
Page 6: ...Hardware connect sketch map Front Back BPI R1 hardware interface 6...
Page 7: ...BPI R1 hardware interface 7...
Page 8: ...BPI R1 hardware spec BPI R1 hardware spec 8...
Page 14: ...J13 P01 UART0 RX PB23 J13 P02 UART0 TX PB22 BPI R1 GPIO Pin define 14...
Page 28: ...please note value 0 value 1 press is 1 unpress is 0 BPI R1 IR interface 28...
Page 41: ...BPI R1 RoHS Certification BPI R1 CE FCC RoHS Certification 41...
Page 42: ...BPI R1 CE FCC RoHS Certification 42...
Page 43: ...BPI R1 Software BPI R1 support linux android and openwrt system BPI R1 Software 43...
Page 59: ...Linux kernel 3 4 BSP image 59...