1
0

it's not perfect but it's better i think?

This commit is contained in:
dtb 2022-12-31 04:18:06 -05:00
parent 42127863a4
commit f3f8ec8cec

View File

@ -3,16 +3,24 @@ set -e
if ! command -v curl >/dev/null 2>&1; then if ! command -v curl >/dev/null 2>&1; then
printf "This script depends on curl.\n" printf "This script depends on curl.\n"
exit 1 exit 64 # sysexits(3) EX_USAGE
fi fi
ZELDA="https://archive.org/download/cirno_actually_plays_zelda_in_terminal/zelda.wav" 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 else
printf "Unknown sound device. Sorry!\n" printf "Unknown sound device. Sorry!\n"
exit 1 exit 70 # sysexits(3) EX_SOFTWARE
fi fi
exit 0 exit 0