Banana Pi BPI-M1 Manual page 29

Table of Contents

Advertisement

BPI-M1 MIC
# 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
29

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents