I’m creating a sound stream like this:
exinfo.pcmreadcallback = pcmreadcallback; /* User callback for reading. /
exinfo.pcmsetposcallback = pcmsetposcallback; / User callback for seeking. /
exinfo.userdata = new FMODSoundData(bufferSize4); // =32KB for 4608-byte packets
info(“before creating stream”);
result = system->createStream(0, mode, &exinfo, &sound);
info(“after creating stream”);
and in my pcmreadcallback method
I have a printout whenever it is called:
FMOD_RESULT F_CALLBACK pcmreadcallback(FMOD_SOUND* sound,
// some code
println (“pcmreadcallback called”);
In my console, I’m getting 8 invocations of pcmreadcallback when createStream is called.
eg in console:
before creating stream
pcmreadback called x 8
after creating stream
Why is this so?
Is there something I’m overlooking? Is it normal for pcmreadcallback to be called during createStream?
I’ve tested with fmod 1.6.10 and 1.5.09 and both exhibit the same behaviour.
As soon as you open a stream, it prebuffers , ready for instant playback. You can use FMOD_NONBLOCKING if you dont want it to stall the main thread. FMOD_OPENONLY is not a good idea as it will mean a large delay before the sound starts, because you didnt prebuffer anything.
Please login first to submit.