From 1bc39234951f5812778416d05b482022ac206edf Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sat, 25 Sep 2010 05:52:37 +0000 Subject: [PATCH] patch from Peter Ross that fixes typo in README.txt, and makes menu.sh work with aplay or ossplay, if SoX play is not found git-svn-id: https://svn.code.sf.net/p/freetel/code@195 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2/README.txt | 6 +++++- codec2/script/menu.sh | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/codec2/README.txt b/codec2/README.txt index 7cf3a395..cf506c94 100644 --- a/codec2/README.txt +++ b/codec2/README.txt @@ -13,7 +13,11 @@ $ cd codec2/src $ make $ ./c2enc ../raw/hts1a.raw hts1a_c2.bit $ ./c2dec hts1a_c2.bit hts1a_c2.raw -$ ../scripts/menu.sh ../raw/hts1a.raw hts1a_c2.raw +$ ../script/menu.sh ../raw/hts1a.raw hts1a_c2.raw + +For playback testing, menu.sh requires either the 'play', 'aplay' or +'ossplay' programs to be installed (see http://sox.sourceforge.net/, +http://www.alsa-project.org/, or http://www.opensound.com/ respectively). Programs -------- diff --git a/codec2/script/menu.sh b/codec2/script/menu.sh index d7305411..3713522a 100755 --- a/codec2/script/menu.sh +++ b/codec2/script/menu.sh @@ -62,7 +62,15 @@ while true ; do if [ $readchar == 'q' -o $readchar == 'Q' ] ; then exit 0 fi - play -r 8000 -s -2 ${file[$readchar]} $dsp 2> /dev/null + if ( play --version ) >/dev/null 2>&1; then + play -r 8000 -s -2 ${file[$readchar]} $dsp 2> /dev/null + elif ( aplay --version ) > /dev/null 2>&1; then + aplay -r 8000 -f S16_LE ${file[$readchar]} 2> /dev/null + elif ( ossplay -f? ) > /dev/null 2>&1; then + ossplay -s8000 -fS16_LE ${file[$readchar]} 2> /dev/null + else + echo "could not find play, aplay or ossplay program" + fi fi done echo -- 2.25.1