2021-04-25 21:48:00 -04:00
|
|
|
#!/bin/sh -x
|
2021-05-10 08:51:22 -04:00
|
|
|
set -e
|
2021-04-25 21:42:59 -04:00
|
|
|
|
2022-02-01 09:30:02 -05:00
|
|
|
if ! command -v curl >/dev/null 2>&1; then
|
|
|
|
|
printf "This script depends on curl.\n"
|
2022-12-31 04:18:06 -05:00
|
|
|
exit 64 # sysexits(3) EX_USAGE
|
2021-04-25 21:42:59 -04:00
|
|
|
fi
|
|
|
|
|
|
2022-08-30 11:40:40 -04:00
|
|
|
ZELDA="https://archive.org/download/cirno_actually_plays_zelda_in_terminal/zelda.wav"
|
2022-12-31 04:18:06 -05:00
|
|
|
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
|
2021-04-25 21:42:59 -04:00
|
|
|
|
|
|
|
|
else
|
|
|
|
|
printf "Unknown sound device. Sorry!\n"
|
2022-12-31 04:18:06 -05:00
|
|
|
exit 70 # sysexits(3) EX_SOFTWARE
|
2021-04-25 21:42:59 -04:00
|
|
|
fi
|
|
|
|
|
|
2021-05-10 08:51:22 -04:00
|
|
|
exit 0
|