Hi guys (& gals probably),
I want to build an application which plays the audio files (such as mp3 or ogg) from a network device/server in some way. I’m able to request a certain part of a file, ie buffer, using Borland C-Builder Socket Components. But then I have to feed it via a custom file callback into FMOD. And that’s my problem. When using the socket functions to request a file, the event of the incoming buffer triggers after the FMOD file read function has finished. (Thats a brief overview of my problem, I may give further details if needed)
I know there are people out there who solved this problem of custom network streaming already.. .would you be so kind and let me take part of your knowledge?
Thanks to the helpers.
Yes, I tried that already, but it has some problems, which I haven’t solved yet…
1. It does only support mp3 and OGG, it would be nice to have wave and mp2 as well.
- The Stream_SetTime functions don’t work properly: I can jump ahead in the stream, but it’s somehow limited. Example: I’m playing a file, set the time 10000 ms ahead of the current position, but the stream only jumps ~1000 ms ahead. The same when I play the file from the beginning, and set the position to somewhere near the end. The stream jumps just a few seconds ahead. And after repeating those jumps for some times, the function does nothing.
Or do I want too much here?
Can you convert your data to mp3 or ogg? They give great compression and are well suited to internet streaming while formats like wav are not. We don’t plan on supporting wav or mp2 for internet streaming.
Seeking with FSOUND_Stream_SetTime can’t work for internet streams like it does for normal streams because there’s no way to seek over the network. It’s possible, of course, but you’d need a special server that understood seeking. SHOUTcast and Icecast are based strongly on the HTTP protocol which has no facility for seeking.
If you absolutely must have seeking and wav/mp2 then I suggest using a custom stream rather than just overriding the file callbacks. Simply buffer your data from the network, decode it if necessary and then feed it to your custom stream. Check out the fmod example programs and search the forums for more info on working with custom streams.
Please login first to submit.