Class AudioUtils
public static class AudioUtils- Inheritance
- 
      
      AudioUtils
- Inherited Members
Fields
StandardSoundModes_2D
public const MODE StandardSoundModes_2D = _2D | ACCURATETIMEField Value
- MODE
StandardSoundModes_3D
public const MODE StandardSoundModes_3D = _3D | ACCURATETIME | _3D_LINEARSQUAREROLLOFFField Value
- MODE
StandardSoundModes_Stream
public const MODE StandardSoundModes_Stream = _2D | CREATESTREAM | ACCURATETIMEField Value
- MODE
Methods
CreateSound(string, MODE)
public static Sound CreateSound(string path, MODE mode = MODE.DEFAULT)Parameters
- pathstring
- The path of the sound. Relative to the base game folder.
- modeMODE
Returns
- Sound
- The FMOD.Sound instance
CreateSound(AudioClip, MODE)
public static Sound CreateSound(AudioClip audio, MODE mode = MODE.DEFAULT)Parameters
- audioAudioClip
- the AudioClip to make a Sound instance of.
- modeMODE
Returns
- Sound
- The FMOD.Sound instance.
CreateSounds(IEnumerable<string>, MODE)
public static IEnumerable<Sound> CreateSounds(IEnumerable<string> soundPaths, MODE mode = MODE.DEFAULT)Parameters
- soundPathsIEnumerable<string>
- Sound paths to create from. Relative to the base game folder
- modeMODE
- The mode to set the sound to
Returns
- IEnumerable<Sound>
- A collection of FMOD Sounds.
CreateSounds(IEnumerable<AudioClip>, MODE)
public static IEnumerable<Sound> CreateSounds(IEnumerable<AudioClip> clips, MODE mode = MODE.DEFAULT)Parameters
- clipsIEnumerable<AudioClip>
- AudioClips to create from.
- modeMODE
- The mode to set the sound to
Returns
- IEnumerable<Sound>
- A collection of FMOD Sounds.
GetFmodAsset(string, string)
Returns a new FMODAsset with the given parameters. An FMODAsset is a data object that is required for various audio-related classes and methods, since it holds references to internal sound IDs.
A list of vanilla sound paths for SN1 can also be viewed at this URL: https://github.com/SubnauticaModding/Nautilus/tree/master/Nautilus/Documentation/resources/SN1-FMODEvents.txt.
The best way to assign a "path" to a custom sound asset is through RegisterCustomSound(string, Sound, string).
public static FMODAsset GetFmodAsset(string path, string id = null)Parameters
- pathstring
- An FMOD Event's 'path' is the part read by most audio systems within Subnautica. - For custom sounds, should be identical to the ID passed into the methods when creating sounds with the CustomSoundHandler class. - For vanilla sounds, please refer to the list of all sound events. 
- idstring
- The internal sound ID, typically unused but occasionally required. Will be set as pathif unassigned.
Returns
- FMODAsset
TryPlaySound(Sound, Bus, out Channel)
public static bool TryPlaySound(Sound sound, Bus bus, out Channel channel)Parameters
- soundSound
- The sound which should be played.
- busBus
- The bus to play the sound on.
- channelChannel
- The channel on which the sound was created.
Returns
- bool
- If the sound was reported as played.
TryPlaySound(Sound, string, out Channel)
public static bool TryPlaySound(Sound sound, string busPath, out Channel channel)Parameters
- soundSound
- The sound which should be played.
- busPathstring
- The path to the bus to play the sound on.
- channelChannel
- The channel on which the sound was created.
Returns
- bool
- If the sound was reported as played.