You are not logged in.

#1 2010-06-04 18:35:49

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

[Solved] A unique way to listen to radio streams?

Hi there,

Basically I like to listen to two radios: BBC Radio 3 and Jazz FM.
The first one uses a wma format (http://www.bbc.co.uk/radio/listen/live/r3.asx) while the second one is a mms stream (mms://stream1.uk.ipercast.net/jazzfm.com/live1).

I would like to have a unique way to listen to online radio streams, no matter what is their format.
For Jazz FM I managed to use mpd+sonata and it works great. Unfortunately it seems impossible to listen to wma radio streams using mpd, so I'm forced to listen to BBC Radio 3 through Firefox.

Both of them seem to play quite nicely with gnome-mplayer but I find it to be rather unconfortable to play radio streams as every time I need to copy the address, then select File --> Open Location and paste the address.

Is there a simple way to play wma streams in mpd(-sonata)?
Or
Is there a way to play radio streams in (gnome-)mplayer in a way that streams address are saved to files and then just loaded, without having to paste the full address every time?

I hope my requests to be understandable... roll

Thank you! big_smile

Last edited by rent0n (2010-06-05 21:33:56)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#2 2010-06-04 18:41:55

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: [Solved] A unique way to listen to radio streams?

you could always just add two bash alaises:

alias play_bbc='mplayer http://bbc.co.uk/radio/listen/live/r3.asx'
alias play_jazz='mplayer mms://stream1.uk.ipercast.net/jazzfm.com/live1'

obviously add whatever mplayer flags are needed.

you could also write a wrapper script with favorites or read-from-file support, but that might be overkill.

Offline

#3 2010-06-04 19:04:53

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: [Solved] A unique way to listen to radio streams?

I made a little perl script for this puprpose some while ago.
It stores the urls and the stationnames in a hash-variable.

#!/usr/bin/perl
# radio.pl
# give "list" or a stationname as cli argument
# without argument enter interactive inputting a stationname
use strict;
use warnings;

my %stations = (
'barcelonajazz' => 'http://www.live365.com/play/jmestres',
'dradio' => 'http://dradio.ic.llnwd.net/stream/dradio_dlf_m_a.ogg',
'bbcworld' => 'mms://a973.l3944038972.c39440.g.lm.akamaistream.net/D/973/39440/v0001/reflector:38972',
'radiopego' => 'http://www.radiopego.com:8000',
);
my @stationnames = keys %stations;
#my @links = values %stations; # not needed yet but might be useful
my $cliarg;
if ( defined $ARGV[0] ) {
    my $cliarg = $ARGV[0];
    if ( $cliarg eq "list" ) {
        print "@stationnames\n";
        exit 0;
    }
    if ( grep { $_ eq $cliarg } @stationnames ) {
        system("/usr/bin/mplayer -msgcolor -msgmodule $stations{$cliarg}");
    } else    {
        print "Please provide a valid radio station name commandline argument. (use \"list\" as argument to see a list of names)\n"; 
        exit 1;
    }
} else {
    my $selection;
    print "Enter the name of the radio station.", "\n";
    $selection = <STDIN>;
    chomp($selection);
    if ( grep { $_ eq $selection } @stationnames ) {
        system("/usr/bin/mplayer -msgcolor -msgmodule $stations{$selection}");
    } else    {
        print "Please provide a valid radio station name. (use \"list\" as argument to see a list of names)\n"; 
        exit 1;
    }
}

Also, you might want to check dmz's rpd for a more sophisticated approach to using a  frontend to mplayer.

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#4 2010-06-04 19:26:53

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: [Solved] A unique way to listen to radio streams?

You can recompile mpd with --enable-ffmpeg (download the PKGBUILD and edit it).
You can also try adding mplayer support http://www.musicpd.org/forum/index.php?topic=1261.0.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#5 2010-06-05 07:04:21

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,464

Re: [Solved] A unique way to listen to radio streams?

Xt7-player or smplayer could work (just add the streams to the playlist)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#6 2010-06-05 10:14:19

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: [Solved] A unique way to listen to radio streams?

When you say unique... May I suggest the Radio Playing Daemon?

The main purpose of this project is to make it as easy to listen to radio
streams (and control them) like it is to control MPD.

It uses mplayer as the backend, the channels are listed in the RPD::URI module
(./lib/RPD/URI.pm), it have playback history and the server/client model makes it
easy to add keybindings for switching channels, pause the playback, bump up the
volume etc.

I'm not used to bragging like this, but personally I think it kicks ass. smile

Edit: Oh, Ogion covered that already. smile Would you like to join the project?

Last edited by dmz (2010-06-05 10:16:03)

Offline

#7 2010-06-05 21:33:39

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Solved] A unique way to listen to radio streams?

Wow, I didn't expect to have such a variety of available solutions: I will definitely look into them (rpd especially) when I'll have some time.
For the time being, I just followed kokoko3k's advice and saved my streams as playlists on gnome-mplayer: it does the job.

Thank you very much guys, and feel free to continue posting other solutions! wink


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#8 2010-06-05 22:45:03

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: [Solved] A unique way to listen to radio streams?

You were asking me, dmz? If so, thanks for the suggestion, but i didn't listen to any radio in the last months, so i didn't really look into rpd/use it yet. But i will keep it in mind smile

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

Board footer

Powered by FluxBB