Skip to content

Instantly share code, notes, and snippets.

@JGrossholtz
Created September 7, 2021 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JGrossholtz/477ad8e93d1d065c453e3dfa77ffd94c to your computer and use it in GitHub Desktop.
Save JGrossholtz/477ad8e93d1d065c453e3dfa77ffd94c to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Play an mp3 file at start with the wifiberry-miniamp.
# Loads all necessary modules and uses ffplay (ffmpeg) to
# play the file.
#
start() {
echo "loading modules"
modprobe snd_soc_pcm5102a
modprobe snd_soc_bcm2835_i2s
modprobe snd_soc_rpi_simple_soundcard
ffplay -af 'volume=0.1' -autoexit -nodisp /root/elephant.mp3&
}
case "$1" in
start)
start
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment