diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-11 17:32:13 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-11 17:32:13 +0100 |
commit | feb30e3651606cd7e1350d33cf42973bdab9ee3b (patch) | |
tree | cf3baa559d5a8126d899d0db8eb76fafc011667b /encode-alsasrc-sox-mpeg.sh | |
parent | a0b3cfc083a9a5597b9f677c07dd8d2b01dbb963 (diff) | |
download | mmbtools-aux-feb30e3651606cd7e1350d33cf42973bdab9ee3b.tar.gz mmbtools-aux-feb30e3651606cd7e1350d33cf42973bdab9ee3b.tar.bz2 mmbtools-aux-feb30e3651606cd7e1350d33cf42973bdab9ee3b.zip |
add example script for toolame encoding with ZMQ
Diffstat (limited to 'encode-alsasrc-sox-mpeg.sh')
-rwxr-xr-x | encode-alsasrc-sox-mpeg.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/encode-alsasrc-sox-mpeg.sh b/encode-alsasrc-sox-mpeg.sh new file mode 100755 index 0000000..3942ac1 --- /dev/null +++ b/encode-alsasrc-sox-mpeg.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Read audio from ALSA input using sox, and encode with toolame, +# send to ZMQ +# +BITRATE=$1 +DST=$2 +ALSASRC="default" + +if [ "$DST" == "" ] +then + echo "Usage:" + echo " $0 <bitrate> <zmq destination>" + exit 1 +fi + +sox -t alsa $ALSASRC -b 16 -t raw - rate 48k channels 2 | \ + ../toolame/toolame \ + -s 48 -D 4 -b $BITRATE /dev/stdin $DST + |