Moode Forum
[SOLVED] How do I program a button to play a stream? - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] How do I program a button to play a stream? (/showthread.php?tid=4045)



How do I program a button to play a stream? - jmperagine - 07-22-2021

Newbie here,

Rasp. 3B+ with IQaudio DAC+

I've got Moode setup with a few custom stations.
Add a few buttons for Next and Prev.
Trying to get a third button to play specific station.

I've tried: 

mpc,play,NameOfStation

mpc,load,NameOfStation

should I put in the entire url? like:  mpc,play,streamurl  ?


RE: How do I program a button to play a stream? - the_bertrum - 07-22-2021

Put the mpc commands in a shell script file then put the path to the script in the button command.


RE: How do I program a button to play a stream? - Tim Curtis - 07-22-2021

Alternatively

Code:
mpc add PLAYABLE_URL

# Example for Groove Salad station
mpc add http://ice1.somafm.com/groovesalad-128-aac

ETA: You can find the playable url via Audio info or Edit the station


RE: How do I program a button to play a stream? - jmperagine - 07-27-2021

(07-22-2021, 02:10 PM)Tim Curtis Wrote: Alternatively

Code:
mpc add PLAYABLE_URL

# Example for Groove Salad station
mpc add http://ice1.somafm.com/groovesalad-128-aac

ETA: You can find the playable url via Audio info or Edit the station

Thank you!

SSH'd in

changed directories to:  /home/pi/

sudo nano preset1.sh

MPC clear
MPC add https://streams.radiomast.io/d01056xxxxxxxxxxxxxxxxxxxxxxxxxx
MPC play

saved and then typed:

sudo chmod +x preset1.sh  to make executable

then setup Button 1 "ON" PIN 17 CMD /home/pi/preset1.sh

this works like a charm

duplicated for a few other presets


RE: How do I program a button to play a stream? - Tim Curtis - 07-27-2021

When u get a moment edit your thread (post #1) and mark it as SOLVED :-)