Streaming Radio

All your problems with Audio, Video and Images.

Streaming Radio

Postby ukemasta » Wed Feb 23, 2011 1:06 am

My project is to stream a radio station to an android app. I dont know where to start to learn how to stream it. Can anyone help me?

Can I stream a station that is already streaming on the internet? wouldn't that be easier? How do I get the stream into eclipse so I can use it? Would it be through a URL somehow?

Do I use the mediaplayer class to get and play the stream? Or do I use the Audiomanager class??

Thanks for Any Help. I am new at this so excuse me
ukemasta
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:10 am

Top

Re: Streaming Radio

Postby Kerbik » Wed Feb 23, 2011 11:40 am

Hello,
actualy I'm not really sure what do you want achieve ....

you can play streamed radio (which already has stream) but it have to be in format .mp3 beacause android limitation... to play streams in different format needs a lot of coding and debuging work.

How to stream .mp3?
this question was here few topics bellow

http://www.anddev.org/multimedia-problems-f28/streaming-mp3-radio-using-mediaplayer-wont-work-t50869.html

basicaly you need to create media player with defined path to stream right when you are creating it like i showed it in that topic.

Kerbik :)
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Re: Streaming Radio

Postby ukemasta » Wed Feb 23, 2011 5:48 pm

Hi thanks for your help. I want to achieve streaming a radio station to an android app. I took a look at the link and it helped me a lot. I just had a couple questions about the stream itself.


Since we only can stream mp3's how do I know that a stream is a mp3 stream?
How do I know that I can grab a mp3 stream? Most streams have players associated with them. Does anyone know a way that I can host a mp3 stream just to test if the stream works?

Thanks for all the help!
ukemasta
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:10 am

Re: Streaming Radio

Postby ukemasta » Wed Feb 23, 2011 7:43 pm

How did you stream a file? I can't figure out how to stream a mp3. so I can test it. Since it only has to be mp3 it is hard to find a stream.

thanks for the help
ukemasta
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:10 am

Re: Streaming Radio

Postby Kerbik » Wed Feb 23, 2011 11:42 pm

hello,
I'd like to hear that it helped to you ....

you can test it for example on http://62.44.1.26:8000/dance-radio64.mp3 ... its one of Radios in Czech republic and strem is working (not tested on android yet but it should work)

Kerbik.


PS:


so for you code should looks like:

Code: Select all
   private MediaPlayer mMediaPlayer;
   Uri uri = Uri.parse("http://62.44.1.26:8000/dance-radio64.mp3");
   mMediaPlayer = MediaPlayer.create(this, uri);
   mMediaPlayer.start();
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Re: Streaming Radio

Postby ukemasta » Thu Feb 24, 2011 1:50 am

Hi!

yes that helped. it does work. Although the station that I am attempting to stream is not a mp3 station.

I believe it is a asf file because it will be a streaming radio station

http://209.51.180.52/pacificradio-klhi-64?MSWMExt=.asf

the original place I got this from was http://v3.player.abacast.com/player/pla ... radio_klhi or http://www.native925.com/pages/4454216.php

can you point me in the right direction to figure out how to convert it? or is there another way I can set something up to allow me to get mp3 stream of that station.

thanks for the help
ukemasta
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:10 am

Top

Re: Streaming Radio

Postby Kerbik » Thu Feb 24, 2011 7:11 pm

Actually I'm not even sure if that is doable....

maybe you can make it anyhow by transforming it from that .asx into mp3 on the fly

there could be 2 options how to solve it ....

1) make your own server (linux?) and start there some kind of transcoding server which will change it to mp3 stream on the fly and after that you can download it on android and play...

2) a lot of coding work on android (ndk probably) and somehow decode it and play :) I don't have any suggestion how to make this .... sorry man

Kerbik

PS: easier will be find some kind of mp3 stream and maybe you could ask that radio station if they can start 1 mp3 stream ...
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 17 guests