Table of Contents

Interface IFModSoundBuilder

Namespace
Nautilus.FMod.Interfaces
Assembly
Nautilus.dll
The interface for registering FMOD Sounds using the FModSoundBuilder class.
public interface IFModSoundBuilder
Extension Methods

Methods

Register()

Finalizes and registers the FMOD event with the given settings.
void Register()

SetFadeDuration(float)

Sets the fade duration for the sound, which applies when it is stopped.
IFModSoundBuilder SetFadeDuration(float fadeDuration)

Parameters

fadeDuration float
The length of the fade in seconds.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

SetMode(MODE)

Sets the current mode to mode, overriding any previous value.
IFModSoundBuilder SetMode(MODE mode)

Parameters

mode MODE
The set of mode flags to use for the sound. See here for documentation.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

SetMode2D(bool)

Sets the mode to StandardSoundModes_2D.
IFModSoundBuilder SetMode2D(bool looping = false)

Parameters

looping bool
If true, the sound also uses the FMOD.MODE.LOOP_NORMAL flag.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

SetMode3D(float, float, bool)

Sets the mode to StandardSoundModes_3D.
IFModSoundBuilder SetMode3D(float minDistance, float maxDistance, bool looping = false)

Parameters

minDistance float
The distance where volume falloff begins.
maxDistance float
The maximum distance that the sound can be heard from.
looping bool
If true, the sound also uses the FMOD.MODE.LOOP_NORMAL flag.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

SetModeMusic(bool)

Sets the mode to StandardSoundModes_Stream.
IFModSoundBuilder SetModeMusic(bool looping = false)

Parameters

looping bool
If true, the sound also uses the FMOD.MODE.LOOP_NORMAL flag.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

SetSound(string)

Uses a sound from the sound source that matches the name defined in clipName. Does not use file extensions.
IFModSoundBuilder SetSound(string clipName)

Parameters

clipName string
The name of the sound to load. File extensions should not be used.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

SetSounds(bool, Func<string, bool>)

Loads multiple sounds for this sound event, using each one for which the predicate returns true. Does not use file extensions.
IFModSoundBuilder SetSounds(bool randomizeOrder, Func<string, bool> predicate)

Parameters

randomizeOrder bool
If true, the sounds will play in a random order instead of sequentially.
predicate Func<string, bool>
The predicate that defines which sounds should be loaded. The file extension is not passed and should not be considered.

Returns

IFModSoundBuilder
A reference to the builder for further setup.

Remarks

This method traverses over every sound in the sound source, making it considerably slower than other methods.

SetSounds(bool, params string[])

Loads multiple sounds for this sound event, locating each by name. Does not use file extensions.
IFModSoundBuilder SetSounds(bool randomizeOrder, params string[] clipNames)

Parameters

randomizeOrder bool
If true, the sounds will play in a random order instead of sequentially.
clipNames string[]
The names of the sounds to load. File extensions should not be used.

Returns

IFModSoundBuilder
A reference to the builder for further setup.