You are not logged in.

#1 2014-01-08 18:27:41

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Which console audio player for streaming?

Hello folks,

I'm using an arch linux system on Raspberry Pi to constantly stream webradio. Currently, I'm using moc, which has one problem: When the connection the stream gets lost, it stops playing.

Can anyone tell me a console player with the capability of auto-reconnect when the connection is lost?

Wolle

Offline

#2 2014-01-09 04:46:47

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Which console audio player for streaming?

sounds like a really short bash script.

check status of moc. when status is "stopped", try to play every couple of seconds, until status constantly changes.

without knowing moc, something like this:

#!/bin/bash
mocpstate=`mocp --info | grep State | cut -d" " -f2`
if [[ $mocpstate = "STOP" ]]; 
    then
    while true; do
        mocp play
        sleep 1
    done
else
    echo "moc is still playing"
elif

(NOT tested, but its something like this)

Last edited by Rasi (2014-01-09 04:51:28)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2014-01-10 08:36:36

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: Which console audio player for streaming?

The problem is, moc doesn't switch to status Stop when the connection is lost...

Offline

#4 2014-01-10 11:20:11

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Which console audio player for streaming?

WolleTD wrote:

The problem is, moc doesn't switch to status Stop when the connection is lost...

...which you totally forgot to mention in your first post smile


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#5 2014-01-27 10:32:23

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: Which console audio player for streaming?

Just to let you know: I found a --timeout parameter on mpg123, working great.

Offline

Board footer

Powered by FluxBB