In the “stream” example I learnt how to stream an existing file “as it is” (without modifying the raw data read from the disk).
In the “stream2” example I learnt how to fill an empty stream buffer, with data generated on-the-fly (not read from any file).

Is there a way to actually “load” a file to stream (as you would do with the FSOUND_Stream_OpenFile function), but then, instead of just playing it with FSOUND_Stream_Play, modify it on-the-fly (as you would in the callback “streamcallback” from the “stream2” example)?

I want to read a file from the disk, stream it, but with slight differences every time it loops (for example in the wave frequency), just as it’s done in the “streamcallback” mentioned before.

I’m using SIGNED RAW streams, so I don’t have to decode them.


  • You must to post comments

Right now I’m using an fread, and everything works.
I don’t understand when EXACTLY the callback is called.
I mean: if it’s called when the buffer has to be filled, I should hear a short pause during every callback, for the time I need to fill the buffer from the hard-disk.
But this doesn’t happen: except when “len” isn’t too small, the stream sounds perfect! How does it work? Is there a “correct” value for len?

I’d like to know it because I want to add other functions in the callback, before or after the fread (like, for example, decoding the file..)

Thanks for everything!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.