it's not perfect but it's better i think?
This commit is contained in:
parent
42127863a4
commit
f3f8ec8cec
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user