sorry for the double post, but now i have to do real streaming with raw data:P I've looked in the example and i saw that you have to call mmStreamUpdate manually. but i'm very new to streaming. i can decode some music intro raw music and play that part, but that part is only 4k raw music, not very much to hear so i have to update the stream every time as the example said to hear the whole file, but how? my situation:

i've an audio file, 44100hz 2 channels, i decode 4k of the current part of the audio file in my decode function.

but how do i know when i've to update the buffer and call mStreamUpdate manually?

When you call mmStreamUpdate, it gives you the number of samples that needs to be filled.

Do you need to decode exactly 4k samples? If so, then you want to have a buffer size that is a bit larger than 4k, so you have enough room to decode into, plus enough room for some overhead and then the actual sample decoding. 5k buffer size should be safe with simple raw data. In your stream update routine, you don't have to fill all of the samples that are requested, so you can decode 4k blocks at a time. You first check if the 'length' parameter given to see if it is >= 4096, and then you fill that many samples and then return '4096' so it knows that's how many samples you filled. If it's less than 4096 then you can just return 0 and the streaming request will be saved for the next call (and more samples will be requested). The remaining amount of samples that weren't filled are saved for the next time you call mmStreamUpdate.

Note that this only applies for the 'manual' streaming mode. In the automatic mode the mmStreamUpdate function is called internally and you must fill all of the samples requested.

you said that mmStreamUpdate returns how much samples need to be filled? so say it returned 2000 i could fill 2000 samples with a bit modified function? and am i understanding the function mmStreamUpdate correctly, because i think it returns how much samples the stream needs and I have to decode that amount to the addres it returns. but like this i don have to care about timing? and i don't need to decode 4096 bytes, it may variate. but you said samples, and i'm talking about decoded data in bytes, is this very different or not?

For OGG decoding I would assume a much heavier load so I would go with probably an 8k buffer (4k samples) or so for 4k byte chunks.

Another somewhat unrelated thing to note is that the streaming startup routine will call the stream request function to pre-fill the buffer. So you should make sure the vorbis file is opened before starting the stream (or test for that error in the filling routine).