Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

java - Listen to a shoutcast with Android

since quite some time I'm trying to listen to .pls files (shoutcasts). I have to say that I failed horrible. Since StreamFurious can do it it must be possible. First I tried to connect to the shoutcast via sockets (TCP and UDP) --> failed. I couldn't even receive one byte from the server.

I'm at the verge of tears. I don't even have a clue what's the best way to establish a connection and afterwards continually download/receive the data stream.

I really hope someone can point me to the right direction and give me a short code snippet if available.

Rgds Layne

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can try these resources:

Shoutcast streaming

http://ostermiller.org/shoutgrab/

http://code.google.com/p/streamscraper/

http://code.google.com/p/castor-streamer/

http://mp3imagetagextr.sourceforge.net/ShoutcastPlsDownloader/index.html

From what I can tell, you may need to handle the PLS download (via HTTP if I understand correctly) and parsing yourself, but you can then hand the actual audio stream URLs to MediaPlayer for playback. Assuming those streams are within specifications (and not all are), Android should be able to play them back. But I am not a Shoutcast expert by any means.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...