Problem with playing radio live stream

Post Reply
pascalbianca
Posts: 37
Joined: Monday 18 December 2017 19:20
Target OS: Raspberry Pi
Domoticz version: V3.8153
Location: Susteren
Contact:

Problem with playing radio live stream

Post by pascalbianca » Saturday 17 February 2018 8:34

Hello everyone,

I just get a audio usb for playing music on speakers because the standard pwm/audio from rpi is in juse by my rgb leds.
Now i have the net problem.
When i play a live stream in my terminal with mplayer then i have no problem.
But when i play this in domoticz it sounds like its very fast and then after that no sound.
What could be the problem? Mplayer?
This is my script.:

Code: Select all

#!/bin/bash
# echo Radio538
wget "http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=161&switchcmd=On" > /dev/null
sudo killall mplayer
mplayer -ao alsa:device=default http://20103.live.streamtheworld.com/RADIO538.mp3
Maybe is there another program that also do the samen like in this script so i can test it, but i searched internet and could'nt find a program that dos the samen.

pascalbianca
Posts: 37
Joined: Monday 18 December 2017 19:20
Target OS: Raspberry Pi
Domoticz version: V3.8153
Location: Susteren
Contact:

Re: Problem with playing radio live stream

Post by pascalbianca » Saturday 17 February 2018 9:28

I solved it to change from mplayer to mpc.
This plays in domoticz without any problems.

For the people that have the same isue i did the next.
First i made a file for my radio station.
There i placed the next code.:

Code: Select all

#!/bin/bash
# echo 538
wget "http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=161&switchcmd=On" > /dev/null
sudo killall mpd
mpc clear
mpc add http://20103.live.streamtheworld.com/RADIO538.mp3
mpc play
And for stopping the radio i made this sh file.:

Code: Select all

#!/bin/bash
wget "http://127.0.0.1:8080/json.htm?type=command&param=switchlight&idx=161&switchcmd=Off" > /dev/null &
sudo killall mpd
mpc clear
That its.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests