Skip to content

Instantly share code, notes, and snippets.

@parkerlreed
Created December 8, 2017 22:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parkerlreed/b28ed35a01db638cdefe81651f645090 to your computer and use it in GitHub Desktop.
Save parkerlreed/b28ed35a01db638cdefe81651f645090 to your computer and use it in GitHub Desktop.
ALSA PiFM with auto starting music
#!/bin/bash
modprobe snd-aloop
arecord -fS16_LE -c 2 -r 44100 -Dplughw:0,1 - | pi_fm_rds -freq 104.5 -ps ALSA -rt "Audio playback from Raspberry Pi" -audio - & sleep 10 && mpv /home/parker/Music/Windows\ XP\ -\ Boot.wav
[Unit]
Description=My Miscellaneous Service
After=network.target
Before=systemd-halt.service
[Service]
Type=forking
ExecStart=/usr/bin/alsa-radio
Restart=on-abort
[Install]
WantedBy=multi-user.target
[Unit]
Description=mpv
After=alsa-radio.service
[Service]
ExecStart=/usr/bin/mpv --shuffle --no-audio-display /home/parker/Music/MUSIC
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment