X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=blobdiff_plain;f=usr_bin%2Fsoundtest;h=6146df7f4bcc4b433ac77ec7086d2bd9ff33a42b;hp=101daa4185eb61aafd757dca21f4af14e2ae847b;hb=HEAD;hpb=9fef74081f53d30174118872324fa62d4a8145b5 diff --git a/usr_bin/soundtest b/usr_bin/soundtest index 101daa4..dc57bf3 100755 --- a/usr_bin/soundtest +++ b/usr_bin/soundtest @@ -6,42 +6,11 @@ # License: This file is licensed under the GPL v2. ################################################################################ -PN=`basename "$0"` - -if [ -z "$PLAYER" ] ; then - [ -x /usr/bin/mplayer ] && PLAYER="mplayer" - [ -x /usr/bin/ogg123 ] && PLAYER="ogg123" -fi - -if ! [ $(which $PLAYER) ] ; then - echo "Sorry, neither mplayer nor ogg123 available and \$PLAYER is not set.">&2 - exit 1 +if ! [ "$(command -v speaker-test)" ] ; then + echo "Sorry, speaker-test (from alsa-utils) not available.">&2 + exit 1 fi -if [ -z "$1" ] ; then - FILE="/usr/share/grml/effect.ogg" -else - FILE="$*" -fi - -if ! [ -r "$FILE" ] ; then - echo "Sorry, /usr/share/grml/effect.ogg of package grml-files not available.">&2 - exit 1 -fi - -echo "$PN - trying to play $FILE with $PLAYER - -You do not hear anything? Make sure volume is not turned off. -Adjust mixer settings via aumix or alsamixer. - -Tip: $PN supports some options. -Just provide the file(s) you want to play as argument(s), -adjust player which should be used for playing the files -via environment variable PLAYER. Usage example: - - PLAYER=mplayer $PN /usr/share/grml/effect.ogg /another/file/to/play.mp3 -" - -$PLAYER $FILE && echo "It looks like sound works for you. :-)" || echo "problems with sound? :-(" +exec speaker-test -t wav ## END OF FILE #################################################################