From f3f8ec8cecdec4a8bcb8d90308686ce8618dec46 Mon Sep 17 00:00:00 2001 From: dtb Date: Sat, 31 Dec 2022 04:18:06 -0500 Subject: [PATCH] it's not perfect but it's better i think? --- homepage/zeldb.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/homepage/zeldb.sh b/homepage/zeldb.sh index e1bc3c0..2433db6 100755 --- a/homepage/zeldb.sh +++ b/homepage/zeldb.sh @@ -3,16 +3,24 @@ set -e if ! command -v curl >/dev/null 2>&1; then printf "This script depends on curl.\n" - exit 1 + exit 64 # sysexits(3) EX_USAGE fi ZELDA="https://archive.org/download/cirno_actually_plays_zelda_in_terminal/zelda.wav" +CURL="curl -Ls" + +if command -v aplay >/dev/null 2>&1; # ALSA + then $CURL "$ZELDA" | aplay + +elif ls /dev/dsp >/dev/null 2>&1; # OSS + then curl -L "$ZELDA" >/dev/dsp + +elif command -v audioplay >/dev/null 2>&1; # NetBSD audio(4) + then $CURL "$ZELDA" | audioplay -f -e ulinear -P 16 -s 48000 -if which aplay >/dev/null 2>&1; then curl -L "$ZELDA" | aplay # ALSA -elif ls /dev/dsp >/dev/null 2>&1; then curl -L "$ZELDA" >/dev/dsp # OSS else printf "Unknown sound device. Sorry!\n" - exit 1 + exit 70 # sysexits(3) EX_SOFTWARE fi exit 0