Half-Life: Alyx

Half-Life: Alyx

26 ratings
How to import custom sounds into your mod
By U SUX
How to master the cryptic nature of the current state of vsnds in Source 2
   
Award
Favorite
Favorited
Unfavorite
This guide is outdated! For a better text-based guide see here:
This guide was made before Valve's official documentation of the sound system! If you are looking to make custom sounds, use this guide instead! https://developer.valvesoftware.com/w/index.php?title=Half-Life:_Alyx_Workshop_Tools/Addon_Sounds
Video Guide
I have not tested these guides, but it was made by someone who has previously made a good guide on adding audio to HLA. Please tell me if this works or not for you!

Part 1

Part 2

Additional Sound Tips

Each one of these video guides were made by Beauman Edwards, so thanks to him!
Making your sounds
1. First, get MP3s or WAVs of the sounds you want to add. It is recommended that you use mp3 or wav format, not entirely sure about others.

2. Go to C:\Program Files (x86)\Steam\steamapps\common\Half-Life Alyx\content\hlvr_addons\(YOUR ADDON NAME HERE) and create a folder called "sounds" and a folder called "soundevents" if they aren't there already.

3. Place your sound files into the sounds folder

4. Go into the soundevents folder and create a new text file, call it whatever you like.

5. This should be the format of your text file: (Edit the things enclosed in *, but leave out the *)

<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} --> { *if you aren't sure what to put here, just put music*.*yoursoundnamehere (AVOID SPACES)* = { type = "hlvr_default_3d" volume = 1.000000 use_hrtf = 1.000000 vsnd_files = [ "sounds/*name of your sound file, excluding the extension at the end, your sound file will automatically be converted to vsnd!*.vsnd", ] } }

Here's what it would look like with two sounds, it is important that you follow this syntax when adding new sounds to the list:

<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} --> { *if you aren't sure what to put here, just put music*.*yoursoundnamehere (AVOID SPACES)* = { type = "hlvr_default_3d" volume = 1.000000 use_hrtf = 1.000000 vsnd_files = [ "sounds/*name of your sound file, excluding the extension at the end, your sound file will automatically be converted to vsnd!*.vsnd", ] } *if you aren't sure what to put here, just put music*.*yoursoundnamehere (AVOID SPACES)* = { type = "hlvr_default_3d" volume = 1.000000 use_hrtf = 1.000000 vsnd_files = [ "sounds/*name of your sound file, excluding the extension at the end, your sound file will automatically be converted to vsnd!*.vsnd", ] } }

6. Save your text file and change the file extension of it to ".vsndevts" by right clicking on it and pressing rename. If you are unable to change the file extension or you can't see the ".txt" at the end of your text file on Windows, in your file manager click the "view" tab at the top of the window and then check "File name extensions". If you want to edit this file later, then you can simply right click on it and open it with the text viewer of your choice.

7. Boot up the workshop tools and once the asset browser pops up, search for the names of your mp3 sounds and click on them to see if they work. If they don't show up, restart the workshop tools and try again. If it still doesn't work, make sure that your mp3s are in both C:\Program Files (x86)\Steam\steamapps\common\Half-Life Alyx\content\hlvr_addons\(YOUR ADDON NAME HERE) and C:\Program Files (x86)\Steam\steamapps\common\Half-Life Alyx\game\hlvr_addons\(YOUR ADDON NAME HERE)

8. WHILE Hammer is running along with the asset browser, search for the name of your .vsndevts file and right click, then choose "full recompile". Then right click again and choose "reload".

9. If you did everything correctly, you will be able to go into your hammer editor and add it to a point_soundevent!
Readying the sounds for the workshop
First I must admit, I HAVE NOT TESTED THIS, this small guide was made by player, credit to them is in the special credits! If I ever decide to do this I will definitely clean this up a bit.

1. first you need to create your custom vsnd and vsndevts files according to the guide, and make sure your sounds work in game (tools mode)

2. create such directory structure: Half-Life Alyx\game\hlvr_addons\<your_addon_name>\scripts\vscripts

KEEP IN MIND: it's **game\hlvr_addons** not content\hlvr_addons

3. enter the vscripts, create a file with name "precache.lua" (or whatever name you want, but with ".lua" suffix)

4. open the file, enter such code:

function Precache(context) PrecacheResource("soundfile", "soundevents/<your_soundevents_file>.vsndevts", context) end

if you have more than one event files, use more PrecacheResource lines

vsnd files don't need to be precached

5. open hammer, choose an entity that will spawn at map start (for example a logic_auto)

6. change its "Entity Scripts" property (under "Misc") to "precache.lua" (or the name you selected in step 3)

7. compile map, upload to workshop, test your published version
ADVANCED
If you want your soundevent to have randomness to it, and you already have multiple sound files to use for that purpose, you can format it in this way also:

(Take important note of the commas at the end of each line and make sure only the last line doesn't include a comma)


vsnd_files = [ "sounds/sound1", "sounds/sound2", "sounds/sound3", "sounds/sound4" ]

There are also many different types you can use instead of hlvr_default_3d, here's a list:

type = "hlvr_2d_w_falloff" type = "hlvr_2d_w_occlusion" type = "hlvr_music_2d" type = "hlvr_music_3d" type = "hlvr_music_3d_takeover" type = "hlvr_music_fixed_rotation" type = "hlvr_music_start_multi_quad"
Tips for atmospheric sound making
Editing your sound can go a long way, I would suggest using Audacity[www.audacityteam.org], it's very easy to use and will let you convert your sounds to mp3!

If you want your sound to sound like it's coming from a radio, use a high pass filter, it cuts out some of the bass. I would suggest a frequency of 500-1000 for a radio. also, making the sample rate or bitrate lower can make it sound more gritty.

Vice versa, if you want your sound to sound like it's coming from another room or through a wall, use a low pass filter!

PLEASE for the love of god don't make earrape.

Thanks for reading!

Also please tell me if I made a mistake, leave your questions in the comments.
Special thanks
Thanks to all of these people for helping in making this guide better!

Speeder99123 for finding out more sound types and informing me about a mistake I made

Tin Can for finding out how to add more vsnd files to a sound to add randomness

Timbleweebs for finding out that you have to reload and recompile while Hammer is running

Dyna for finding out that you can use wav files


deluxghost for finding out how to make it work on the workshop

Beauman Edwards for making an awesome video guide
53 Comments
U SUX  [author] May 20, 2022 @ 4:56pm 
Your best bet for getting help from here is maybe checking the past comments and seeing if anyone had the same problem, other than that I can't help. Sorry and gl
MrZitch May 15, 2022 @ 11:03pm 
Heya, I'm just getting back here because the official guide has stopped working for me a few months ago and I was wondering if you had a similar experience or could help me out.

In any case the new sounds won't be visible in Hammer (HLA) in either snd_event_point or point_soundevent. Recompiling/reloading hasn't worked and I've went through the code at least a 100 times already so there aren't any mistakes.

Any advice is appreciated! Cheers
U SUX  [author] May 5, 2022 @ 5:00pm 
Please don't attempt to use this as your main resource on sounds in HLA, as there are plenty of others. this was made because there was zero documentation on it online at the time. I've left it up to point people in the right direction to better resources on it and I've even left links to Valve's official documentation on the sound system at the top of the guide and even left a link a couple comments down. For good measure here's another link: https://developer.valvesoftware.com/w/index.php?title=Half-Life:_Alyx_Workshop_Tools/Addon_Sounds
nuudels May 5, 2022 @ 9:30am 
this guide does not work anymore, there are no working guides on YT either, could someone make a working guide please? if you follow this your sound wont be found in the sound event picker
U SUX  [author] Jun 5, 2021 @ 2:28pm 
Would like to add that the video guide was taken down and updated, so I've added it onto the guide. Good luck!
U SUX  [author] Jun 5, 2021 @ 2:19pm 
yea looks like its taken down for some reason, ive removed it from the guide but for people still looking to make sounds i would highly suggest not following this guide and following valve's official documentation!
https://developer.valvesoftware.com/w/index.php?title=Half-Life:_Alyx_Workshop_Tools/Addon_Sounds
Doctos Jun 5, 2021 @ 1:44am 
the video guide is unavailiable, i think it's region locked, i'm in australia.
don't Feb 10, 2021 @ 2:59pm 
type = "hlvr_music_3d_takeover"
type = "hlvr_music_fixed_rotation"
type = "hlvr_music_start_multi_quad"
so does anyone know what are these?
U SUX  [author] Jun 5, 2020 @ 11:56am 
Sure!
deluxghost Jun 5, 2020 @ 2:31am 
I just realized my steam nick was a temporary id, I changed back to my normal one. could you also change them in the guide, please? :lunar2019crylaughingpig: