Skip to content

Custom Sound System

Melvin "Dumbass" Shwuaner edited this page May 3, 2025 · 11 revisions

NeoModLoader now allows you to load your own custom sounds from your mod into the game. these sounds must have the .WAV file format. sounds also have a data storer which stores data (3D Mode, volume, Type (music / sound), loopcount, Ramp) which is stored in a .json file with the same name as the .wav file (not required), you can also set this data using the ModifyWavData function in the custom soundmanager.

these sounds can be called using musicbox.playsound (recommended) or CustomSoundManager.LoadCustomSound once the sound is created, a channel is created that plays the sound, you can access this channel in CustomSoundManager.ChannelList (you can edit some custom stuff about the channel, like velocity, pitch, etc)

the typical .json file that stores the data looks like

{"Mode":1,"Volume":100.0,"Type":1,"LoopCount":0,"Ramp":true}

Type 1 means Sound, Type 0 means Music, Type 2 means UI

The Volume is from 0-100, with 100 being the loudest

Ramp is used if the sound is very short, to prevent the sound from being glitched

The Mode has 3 values: 0:2D 1: Stereo3D 2 : Mono3D

2D sound's volume dont change stereo3d uses FMOD's 3D system, using a left and right channel. even at max volume it cant be louder then in-game sounds Mono3D uses a Custom 3D system, it only uses one channel but it can become much louder then in-game sounds

Clone this wiki locally