Making custom sounds is simple! You just need to follow some rules:
TIP: If you're going to use .wav files, these are the requirements:
- Sample Rate: 44100 Hz
- 16 Bit
- Mono
If you're using .mp3 files, you just need to put the audio to mono.
First, open the file soundfiles.txt with your favorite text editor, it's located at sourcemod/configs/
You're going to see this:
Code:
"WalkMan"
{
"MvMRoundMusic"
{
"title" "MvM Tank Round only"
"soundfile" "music/mvm_start_tank_wave.wav"
"duration" "14"
}
"MvMRound_AndKillSound"
{
"title" "MvM Tank Round"
"soundfile" "music/mvm_end_tank_wave.wav"
"duration" "17"
"killtitle" "MvM round lost"
"killplay" "music/mvm_lost_wave.wav"
}
}
To create custom sounds, you just need to make a new entry and put your own title/directory etc...
Example:
Code:
"WalkMan"
{
"MvMRoundMusic"
{
"title" "MvM Tank Round only"
"soundfile" "music/mvm_start_tank_wave.wav"
"duration" "14"
}
"MvMRound_AndKillSound"
{
"title" "MvM Tank Round"
"soundfile" "music/mvm_end_tank_wave.wav"
"duration" "17"
"killtitle" "MvM round lost"
"killplay" "music/mvm_lost_wave.wav"
}
"MusicNumber3"
{
"title" "Title that will appear in the menu"
"soundfile" "Music location"
"duration" "Number of seconds to repeat the music"
"killtitle" "Kill Music Title"
"killplay" "Kill Music Location"
}
}
This file is a KeyValues file, it works like a tree. Inside the "MusicNumber3" we can see some parameters: title, soundfile, duration, killtitle, killplay. These parameters builds the functionality. title is the text that will be shown in the menu, soundfile is where the sound file is saved, like musics/gaben.wav, duration is how much time the plugin will waits to repeat the music, killtitle is what will be shown in the "Kill Music Area", like that: Welcome music | Kill Bodyshot sound, the killplay is where the kill sound is saved.
lets see how it looks edited:
Code:
"MusicNumber3"
{
"title" "Gaben Music"
"soundfile" "music/gaben.mp3"
"duration" "13"
"killtitle" "Horn annoying sound"
"killplay" "annoy/horn.wav"
}
Gaben Music | Horn annoying sound is what is going to be shown in the menu, it will play gaben.mp3 each 13 seconds, and horn.wav to the player you killed.
You don't need to have the Kill sound, but the walk sound is required.
The "walk" sound is the "soundfile", and the kill sound is the "killplay".