i’d like to listen to a shoutcast stream with fmod, is that possible ?
Let’s say i’d like to listen to http://22.214.171.124:80/stream/1003 (that’s the Digitally Imported stream url)
how would i do that ?
FSOUND_Init(44100, 16, 0);
stream = FSOUND_Stream_OpenFile("http://126.96.36.199:80/stream/1003", FSOUND_OUTPUT_WINMM, 200); if (!stream) return; FSOUND_Stream_Play(FSOUND_FREE, stream);
would that work ? or is it impossible to do atm ? 😮
- Zap asked 15 years ago
I’ve been looking into it, and it’s not “impossible” to load a shoutcast stream and still use FMOD, but FMOD will not stream a Shoutcast URL directly.
For example, if you have an MP3 file residing on some server, you can stream that file, because FMOD basically plays it back as it downloads. But Shoutcast is a much different protocol than simple streaming.
Shoutcast instead requires a special type of negotiation process, which is why you connect to a .pls file, and then (I haven’t looked into the details) it sends the MP3 stream to the PC/client.
If you can figure out a way to perform the negotiation process (and someone may have written an API out there to do that [I haven’t found it though]) and then load the MP3 data to a buffer in memory (using memcpy), you can then load that buffer using FSOUND_LOADMEMORY flag with FSOUND_Stream_OpenFile() and stream it from memory.
- menelfea answered 15 years ago
Please login first to submit.