Firelight Technologies FMOD Studio API
Sound::setMode
Sets or alters the mode of a sound.
C++ Syntax
FMOD_RESULT Sound::setMode(
FMOD_MODE mode
);
C Syntax
FMOD_RESULT FMOD_Sound_SetMode(
FMOD_SOUND *sound,
FMOD_MODE mode
);
C# Syntax
RESULT Sound.setMode(
MODE mode
);
JavaScript Syntax
Sound.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
When calling this function, note that it will only take effect when the sound is played again with System::playSound. Consider this mode the 'default mode' for when the sound plays, not a mode that will suddenly change all currently playing instances of this sound.
Flags supported:
- FMOD_LOOP_OFF
- FMOD_LOOP_NORMAL
- FMOD_LOOP_BIDI
- FMOD_3D_HEADRELATIVE
- FMOD_3D_WORLDRELATIVE
- FMOD_2D
- FMOD_3D
- FMOD_3D_INVERSEROLLOFF
- FMOD_3D_LINEARROLLOFF
- FMOD_3D_LINEARSQUAREROLLOFF
- FMOD_3D_CUSTOMROLLOFF
- FMOD_3D_IGNOREGEOMETRY
Issues with streamed audio. (Sounds created with with System::createStream or FMOD_CREATESTREAM).
When changing the loop mode, sounds created with System::createStream or FMOD_CREATESTREAM may already have 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. To do this, you can call Channel::setPosition which forces a reflush of the stream buffer.
Note this will usually only happen if you have sounds or looppoints that are smaller than the stream decode buffer size. Otherwise you will not normally encounter any problems.
If FMOD_3D_IGNOREGEOMETRY is not specified, the flag will be cleared if it was specified previously.
See Also
- FMOD_MODE
- Sound::getMode
- System::setStreamBufferSize
- System::playSound
- System::createStream
- Channel::setPosition
- FMOD_CREATESOUNDEXINFO
Version 1.10.03 Built on Feb 1, 2018