ChannelGroup::setMode

FMOD Studio API

Firelight Technologies FMOD Studio API

ChannelGroup::setMode

Changes some attributes for a channel or channelgroup based on the mode passed in.

C++ Syntax

FMOD_RESULT ChannelGroup::setMode(
  FMOD_MODE mode
);

C Syntax

FMOD_RESULT FMOD_ChannelGroup_SetMode(
  FMOD_CHANNELGROUP *channelgroup,
  FMOD_MODE mode
);

C# Syntax

RESULT ChannelGroup.setMode(
  MODE mode
);

JavaScript Syntax

ChannelGroup.setMode(
  mode                             
);

Parameters

mode
Mode bits to set.

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

Flags supported:

Issues with streamed audio:

When changing the loop mode, sounds created with System::createStream or FMOD_CREATESTREAM may have already been pre-buffered and executed their loop logic ahead of time before this call was even made. This is dependant on the size of the sound versus the size of the stream decode buffer (see FMOD_CREATESOUNDEXINFO). If this happens, you may need to reflush the stream buffer by calling Channel::setPosition. Note this will usually only happen if you have sounds or loop points that are smaller than the stream decode buffer size.

Issues with PCM samples:

When changing the loop mode of sounds created with with System::createSound or FMOD_CREATESAMPLE, if the sound was set up as FMOD_LOOP_OFF, then set to FMOD_LOOP_NORMAL with this function, the sound may click when playing the end of the sound. This is because the sound needs to be pre-prepared for looping using Sound::setMode, by modifying the content of the PCM data (i.e. data past the end of the actual sample data) to allow the interpolators to read ahead without clicking. If you use Channel::setMode it will not do this (because different channels may have different loop modes for the same sound) and may click if you try to set it to looping on an unprepared sound. If you want to change the loop mode at runtime it may be better to load the sound as looping first (or use Sound::setMode), to let it pre-prepare the data as if it was looping so that it does not click whenever Channel::setMode is used to turn looping on.

If FMOD_3D_IGNOREGEOMETRY or FMOD_VIRTUAL_PLAYFROMSTART is not specified, the flag will be cleared if it was specified previously.

See Also




Version 1.10.03 Built on Feb 1, 2018