aboutsummaryrefslogtreecommitdiffstats
path: root/encode-alsasrc-sox-mpeg.sh
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-11 17:32:13 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-11 17:32:13 +0100
commitfeb30e3651606cd7e1350d33cf42973bdab9ee3b (patch)
treecf3baa559d5a8126d899d0db8eb76fafc011667b /encode-alsasrc-sox-mpeg.sh
parenta0b3cfc083a9a5597b9f677c07dd8d2b01dbb963 (diff)
downloadmmbtools-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-xencode-alsasrc-sox-mpeg.sh20
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
+