Destinations/Adding Sound: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(clarifying some directories.)
No edit summary
Line 1: Line 1:
= Overview =
== Adding Sound to your Destination ==
The simplest way to add ambient sounds to your Destinations addon is through Soundscapes.


* If it doesn't already, ensure your addon has a '''soundscapes_manifest.txt''' and '''soundscapes_template.txt''' file in the scripts directory under game/steamtours_addons/youraddon.
===== Soundscapes =====
* Rename soundscapes_template.txt to suit the addon, and then adjust the reference in soundscapes_manifest.txt on line 3 accordingly.
The simplest way to add ambient sounds to your Destination is through [[Destinations/Adding Sound/Soundscapes|Soundscapes]].
 
<br />
Documentation on how to create custom soundscape entries exists here -
===== Soundevents =====
[https://developer.valvesoftware.com/wiki/Soundscape]
You can also use [[Destinations/Adding Sound/Soundevents|Soundevents]], which can be set up and triggered through a point_soundevent entity or added to animations.
''Note: Unlike some other Valve titles, Destinations does use reverb DSP.''
 
The map entity required is documented here -
[https://developer.valvesoftware.com/wiki/Env_soundscape]
 
Sound files go in the content/youraddon/sounds/ folder.
 
= Example =
Here is an example of a workflow for a simple soundscape, with a looping ambient bed and some randomized spot sounds around the listener.
 
* In your map, add an env_soundscape entity. Ensure the radius covers the info_player_start entity by moving it closer and/or adjusting the Radius property in Hammer.
 
* In the new env_soundscape entity, set the Soundscape property to the name you want for your soundscape, for example - soundscape_whitelodge
 
* Add your audio files to the sounds folder.  In this case we'll say there is one looping .wav file called "forest.wav" and three ‘spot sound’ .wav files called "owl_01.wav", "owl_02.wav" and "owl_03.wav". Ensure looping sound files have loop markers set up.
 
* Open your soundscapes script and add the following.
 
<pre>
"soundscape_whitelodge"
{
                "playlooping"
                {
                                "volume"        "0.5"
                                "pitch"        "100"
                                "wave"          "sounds/forest.vsnd"
                }
                "playrandom"
                {
                                "volume"        "0.35"
                                "pitch"        "100"   
                                "time"          "10, 15"
                                "soundlevel"    "SNDLVL_50dB"
                                "position"      "random"
                                "rndwave"
                                {
                                      "wave"      "sounds/owl_01.vsnd"
                                      "wave"      "sounds/owl_02.vsnd"
                                      "wave"      "sounds/owl_03.vsnd"                                                 
                                }
                }
}
</pre>
 
''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 soundscape script.''
 
* Build the map and you'd now be able to hear forest.wav looping, and at randomized start times with a 10 to 15 second gap, one of the owl files playing from a random position around the listener.
 
* Adjust the volume, pitch, time and soundlevel to suit. The VConsole command 'cl_soundscape_flush' will allow you to reload the soundscape to hear tweaks.
 
''Note: If the playlooping or playrandom entry does not include a position, soundlevel will not affect anything as there is no falloff of volume over distance.''

Revision as of 14:49, 22 June 2016

Adding Sound to your Destination

Soundscapes

The simplest way to add ambient sounds to your Destination is through Soundscapes.

Soundevents

You can also use Soundevents, which can be set up and triggered through a point_soundevent entity or added to animations.