I’m trying to get streaming internet radio into our existing code but I’m having problems.
I’m using the event system with our own File IO routines via SetFileSystem. When I try to use CreateSound and pass in a URL our open callback is called and it tries to open is as a file and fails.
I see that CreateSound can have its own callback IO routines set, but I can’t see a way of forcing CreateSound to use Fmods built in routines (if SetFileSystem has been set).
If I do not use SetFileSystem the internet radio streams work fine, but none of my events work getEvent returns file not found. I think this is because the fsb files are failing to load, but that appears to be a internal process in FMod and there is no way to set IO callbacks for the event?.
I have found this post from 3 years ago thats seems to be same problem, but it doesn’t have any replies.
Is there any way of using the builtin internet streaming and have custom file IO routines for events?
- Steve101 asked 5 years ago
You would be using a ‘programmer sound’ in the event you are trying to build I assume?
The programmer sound will then create a callback where you return a low level FMOD::Sound object to the event system. This is your internet stream
You don’t even have to override any file callbacks – fmod will stream from the internet for you if you pass the url into createStream.
If you want to use your own net functions, then use FMOD_CREATESOUNDEXINFO and just use the new file callbacks for that sound only. Everything else will use the standard file system.
Good news, I have a solution.
Your suggestion to use FMOD_CREATESOUNDEXINFO on System::CreateSound made me look at the structure again, and I found ‘ignoresetfilesystem’, setting it to one forces that particular sound to use the built in routines. This means you can use System::SetFileSystem to set custom IO callbacks but still create sounds using FMods built IO (in my case for FMods internet stream).
Thanks for the help.
- Steve101 answered 5 years ago
Please login first to submit.