Firelight Technologies FMOD Studio API
FMOD_SOUND_PCMREAD_CALLBACK
Used for 2 purposes.
One use is for user created sounds when FMOD_OPENUSER is specified when creating the sound.
The other use is to 'piggyback' on FMOD's read functions when opening a normal sound, therefore
the callee can read (rip) or even write back new PCM data while FMOD is opening the sound.
C/C++ Syntax
FMOD_RESULT F_CALLBACK FMOD_SOUND_PCMREAD_CALLBACK(
FMOD_SOUND *sound,
void *data,
unsigned int datalen
);
Parameters
sound
Pointer to the sound. C++ users see remarks.
data
Pointer to raw PCM data that the user can either read or write to.
datalen
Length of the data in bytes.
Return Values
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.
Remarks
C++ Users. Cast FMOD_SOUND *
to FMOD::Sound *
inside the callback and use as normal.
The format of the sound can be retrieved with Sound::getFormat from this callback. This will allow the user to determine what type of pointer to use if they are not sure what format the sound is.
If the callback is used for the purpose of 'piggybacking' normal FMOD sound loads, then you do not have to do anything at all, and it can be treated as purely informational. The return value is also ignored.
See Also
- Sound::getFormat
- FMOD_SOUND_PCMSETPOS_CALLBACK
- System::createSound
- System::createStream
- FMOD_CREATESOUNDEXINFO
Version 1.10.03 Built on Feb 1, 2018