Zac Brown
Zac Brown

Reputation: 6093

Convert shoutcast stream to playable samples in Python?

I have a shoutcat radio station and now want to build a player for it. I know how to "get" thet stream from the server, thanks a lot to bobince , but I am not sure how to convert that stream into playable samples. How is it done?

Upvotes: 3

Views: 1585

Answers (3)

bobince
bobince

Reputation: 536765

There are quite a few possibilities for MP3 decoding under Python. PyMedia is one I've had some success with in the past (but for which development seems to have stopped). It's not just an MP3 decoder though, but a playback interface with support for many audio and video formats via ffmpeg. There's also pyffmpeg which seems to have come back to life recently (haven't tried it yet).

Then there's PyGame can also play MP3, though this is a pretty small part of what it does. pymad is more lightweight possibility, being a direct interface to the libmad decoder library. And then there's always the possibility of handing the task off to an external multimedia library such as DirectShow, or GStreamer (via gst-python)...

Upvotes: 1

Brad
Brad

Reputation: 163612

Shoutcast streams are typically (but not always) MP3. To get playable samples, you have to decode the stream's MP3 data.

Have you seen the resource at http://codeboje.de/playing-mp3-stream-python/? Looks like a simple solution, but requires an awful lot of libraries.

Upvotes: 2

Varriount
Varriount

Reputation: 663

Well, from what I can read on python, try this page. If that doesn't work, try the PythonInMusic article on the python wiki.

Upvotes: 0

Related Questions