Firelight Technologies FMOD Studio API

FMOD_CODEC_READ_CALLBACK

Read callback for the codec for when FMOD tries to read some data from the file to the destination format (format specified in the open callback).

C/C++ Syntax

FMOD_RESULT F_CALLBACK FMOD_CODEC_READ_CALLBACK(
  FMOD_CODEC_STATE *codec_state,
  void *buffer,
  unsigned int sizebytes,
  unsigned int *bytesread
);

Parameters

codec_state

Pointer to the codec state. The user can use this variable to access runtime plugin specific variables and plugin writer user data.

buffer

Buffer to read PCM data to. Note that the format of this data is the format described in FMOD_CODEC_WAVEFORMAT.

sizebytes

Number of bytes to read

bytesread

Number of bytes actually read

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

If you cannot read number of bytes requested, simply return FMOD_OK and give bytesread the number of bytes you read.

Read and seek within the file using the 'fileread' and 'fileseek' members of the FMOD_CODEC codec that is passed in.
Note: DO NOT USE YOUR OWN FILESYSTEM.
The reasons for this are:

Remember to return FMOD_OK at the bottom of the function, or an appropriate error code from FMOD_RESULT.

See Also




Version 1.03.06 Built on Apr 17, 2014