diff options
-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 + |