Destinations/Adding Sound/Soundevents

From Valve Developer Community
Jump to: navigation, search

A guide to adding new Soundevents to your Destination

First, sound files go in the content/youraddon/sounds/ folder.

With a text editor, open the provided file, "soundevents_addon.vsndevts" from the content soundevents folder. Do not rename this file to match your addon, just edit the contents.

You add soundevent definitions inside the existing curly braces already present in the file-

Soundevent examples.JPG

Replace 'soundname_01/02' with the name for your soundevent, this is what you will reference elsewhere in the tools to call your sound.

Replacing 'soundtype' inside the quotations with one of the two types explained below will determine the playback behavior of the sound.

An optional parameter requiring a float value, ideally set between 0.0 and 1.0, that acts as a multiplier on the sounds volume. If undeclared, it will default to 1.0.

An optional parameter requiring a float value, that determines the pitch at which the sound plays back. Ideally set it between 0.9 and 1.1 to avoid digital distortion from extreme pitch shifting, but feel free to experiment if you want some crazy sounds. If undeclared, it will default to 1.0.

An optional parameter requiring a float value, representing a millisecond delay between the soundevent being called to start and the sound file playing. If undeclared, it will default to 0.0.

The value here is the sound file you wish to play. Note for soundname_02, the square braces allow for multiple sound files to be added for one soundevent. When the soundevent is called to play, it will respond with one of the files chosen at random. Once a sound file is used it will not be chosen again until the list is exhausted.

Note: The .vsnd extension is for the compiled version of audio files in Source 2. When the sound first plays, it will get compiled into a .vsnd automatically. You don't need to change the audio file extension by hand, just use .vsnd in the script.


There are 2 'type' settings you can use for sound behavior control in Destinations.

For sounds with positional information and that require a falloff of volume against distance. Example usages - a bird call, dog bark, door closing.

For sounds without positional information, whose stereo information will be preserved no matter the orientation of the player. Example usages - non-diagetic music, ambience beds, atmospheric rumbles.