Firelight Technologies FMOD Studio API
Sets the internal buffersize for streams opened after this call.
Larger values will consume more memory (see remarks), whereas smaller values may cause buffer
under-run/starvation/stuttering caused by large delays in disk access (ie netstream),
or cpu usage in slow machines, or by trying to play too many streams at once.
FMOD_RESULT System::setStreamBufferSize(
unsigned int filebuffersize,
FMOD_TIMEUNIT filebuffersizetype
);
FMOD_RESULT FMOD_System_SetStreamBufferSize(
FMOD_SYSTEM *system,
unsigned int filebuffersize,
FMOD_TIMEUNIT filebuffersizetype
);
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Note this function does not affect streams created with FMOD_OPENUSER, as the buffer size is specified in System::createSound.
This function does not affect latency of playback. All streams are pre-buffered (unless opened with FMOD_OPENONLY), so they will always start immediately.
Seek and Play operations can sometimes cause a reflush of this buffer.
If FMOD_TIMEUNIT_RAWBYTES is used, the memory allocated is 2 * the size passed in, because fmod allocates a double buffer.
If FMOD_TIMEUNIT_MS, FMOD_TIMEUNIT_PCM or FMOD_TIMEUNIT_PCMBYTES is used, and the stream is infinite (such as a
shoutcast netstream), or VBR, then FMOD cannot calculate an accurate compression ratio to work with when the file is
opened. This means it will then base the buffersize on FMOD_TIMEUNIT_PCMBYTES, or in other words the number of PCM
bytes, but this will be incorrect for some compressed formats.
Use FMOD_TIMEUNIT_RAWBYTES for these type (infinite / undetermined length) of streams for more accurate read sizes.
Note to determine the actual memory usage of a stream, including sound buffer and other overhead, use Memory_GetStats before and after creating a sound.
Note that the stream may still stutter if the codec uses a large amount of cpu time, which impacts the smaller, internal 'decode' buffer.
The decode buffer size is changeable via FMOD_CREATESOUNDEXINFO.
Version 1.03.06 Built on Apr 17, 2014