🎵 Audio Overrides
Code Referencenamespace: CloverAPI.Content.Audio
class: AudioManager
You can override in-game audio clips with your own custom audio files using the AudioManager
class.
Supported Formats
CloverAPI supports all Unity-supported audio formats: OGG
, WAV
, MP3
, AIF(F)
, MOD
, XM
, IT
, and S3M
. WAV
and OGG
are recommended for best compatibility.
Registering Audio Overrides
To register an audio override, use the AudioManager.RegisterSoundOverride(string name, AudioClip clip, ModGuid guid)
for sound effects or its RegisterMusicOverride
counterpart for music.
The name
parameter is the name of the audio clip to override. The easiest way to find the name is to look at the audio clip's filename in the game's files using a tool like AssetStudio.
The clip
parameter is the AudioClip
instance to use as the override. You can use the AudioUtils.LoadAudioFromFile(string filePath)
method to load an audio clip from a file.
The guid
parameter is the ModGuid
of your mod. Pass either your plugin instance or a string. It'll be converted automatically.