FMOD_OUTPUT_INIT_CALLBACK

FMOD Studio API

Firelight Technologies FMOD Studio API

FMOD_OUTPUT_INIT_CALLBACK

Initialization callback which is called when the user calls System::init.

C/C++ Syntax

FMOD_RESULT F_CALLBACK FMOD_OUTPUT_INIT_CALLBACK(
  FMOD_OUTPUT_STATE *output_state,
  int selecteddriver,
  FMOD_INITFLAGS flags,
  int *outputrate,
  FMOD_SPEAKERMODE *speakermode,
  int *speakermodechannels,
  FMOD_SOUND_FORMAT *outputformat,
  int dspbufferlength,
  int dspnumbuffers,
  void *extradriverdata
);

Parameters

output_state

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

selecteddriver

This is the selected driver id that the user chose from calling System::setDriver.

flags

Initialization flags passed in by the user.

outputrate

Output rate selected by the user. If not possible, change the rate to the closest match. FMOD will resample from the rate requested to your rate if they do not match.

speakermode

Speaker mode selected by the user. If not possible, change the speaker mode to the closest match. FMOD will upmix or downmix to the requested speaker mode if they do not match.

speakermodechannels

Speaker mode channel count selected by the user. For example 1 = mono output. 2 = stereo output. Needed if supporting FMOD_SPEAKERMODE_RAW, otherwise it is informational.

outputformat

Sound format supported by output mode. For example, FMOD_SOUND_FORMAT_PCM16 would be normal. FMOD will convert from FMOD_SOUND_FORMAT_PCMFLOAT (the mixer buffer format) to whatever you specify.

dspbufferlength

Size of the buffer fmod will mix to in one mix update. This value is in PCM samples.

dspnumbuffers

Number of buffers fmod will mix to in a circular fashion. Multiply this by dspbufferlength to get the total size of the output sound buffer to allocate.

extradriverdata

Data passed in by the user specific to this driver. May be used for any purpose.

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

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

See Also




Version 1.10.03 Built on Feb 1, 2018