Error with shoutcast radio stream

I’m trying to play a shoutcast radio stream.

Using the following code and a shoutcast URL results in an HTTP error:

result = system->createStream(“http://yp.shoutcast.com/sbin/tunein-station.pls?id=1817772”, FMOD_DEFAULT, NULL, &musicSound);

However, using VLC to find the location url does work:

result = system->createStream(“http://78.47.158.100:8080/dance.mp3”, FMOD_DEFAULT, NULL, &musicSound);

The docs say FMOD should work with shoucast and .pls files.
Any ideas?

Have you tried our net_stream example?

There is some extra code required for reading the entries in a playlist, then opening those streams.
The example shows how to do that.

Hi Mathew,

I’ve tried the net_steam example and that failed also. Here are my findings:

  1. The example URL works fine.

  2. The shoutcast URL ( http://yp.shoutcast.com/sbin/tunein-station.pls?id=1817772 ) fails with ‘Error 19 Unsupported file or audio format’
    However, I can see that it’s trying to connect to ‘31.12.71.119:80’ which seems to be a placeholder shouctcast page and not an actual radio address.

  3. Direct URL to the station does work ( http://78.47.158.100:8080/dance.mp3 ). So the above format error does not apply to the actual station.

  4. Another example URL ( http://www.defjay.de/listen.pls ) fails with generic ‘Error 21 - HTTP Error’

All of the above URLs work fine with BASS net radio code, so something is not quite right in the FMOD code.

Any ideas?

I have found an internal error in our processing of server response headers causing this to all fall over. It’s an easy fix and will be corrected in our next release. The issue is isolated to that server and any others that work the same way, unfortunately there is no work around.

Great, glad you’ve found a fix.
Is there an ETA on the next release?

Should be about 2 to 3 weeks away.

1 Like

Hi im still having issued with the net_stream example i keep getting FMOD_ERR_NET_URL

Hi, this means the URL you passed in couldnt be resolved.
This is an error from getaddrinfo(). Check your URL formatting, and if you want the specific gettaddinfo error, please use the logging version of FMOD to see what the error was. This will be in an fmod.log file or your debug tty depending on your settings.

1 Like

Definitely was the issue. Following the net_stream example, it just passed a string in to the createSound function. I didn’t know i had to encode that string into a UTF8 format. After doing that stream worked like a charm.

TY.

you dont require utf8 but if you have special characters or maybe a slash the wrong way around it is possible that worked around it by encoding it.