Sound of Mods
Like for adding textures and blocks, we will use the Exdilin API and will start by choosing a name.
There are two kinds of sounds: music and SFX.
Music
It is really simple, first choose a name, we'll choose never_gonna_give_you_up
and our file will be named trolo.ogg
.
The music or SFX file must always be an OGG file. If you have the sound in an other format (like MP3) you can use an online converter.
First here is the init function, in which we will use the exdilin.load_audio
function:
And then the preinit function, which is exactly like for textures except we just replace "texture" by "music":
And voilĂ ! You just added music, A-mA-zInG !
SFX
Once you learnt how to do music, doing SFX is literally just as simple, you just have to replace music_item
by sfx_item
in preinit
and Music
by SFX
in init
:
Really, nothing extraordinary here, you just harnessed the power of music and SFX !
Last updated
Was this helpful?