From feb30e3651606cd7e1350d33cf42973bdab9ee3b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 11 Feb 2014 17:32:13 +0100 Subject: add example script for toolame encoding with ZMQ --- encode-alsasrc-sox-mpeg.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 encode-alsasrc-sox-mpeg.sh 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 " + 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 + -- cgit v1.2.3