Difference between revisions of "Destinations/Adding Sound/Soundevents"

From Valve Developer Community
Jump to: navigation, search
m (Added category.)
(Redirected to current page)
 
Line 1: Line 1:
{{otherlang2
+
#redirect [[SteamVR/Environments/Adding Sound/Soundevents]]
|title = Destinations/Adding Sound/Soundevents
 
|zh-cn=Destinations:zh-cn/Adding Sound:zh-cn/Soundevents:zh-cn
 
}}
 
 
 
=== A guide to adding new Soundevents to your Destination === 
 
 
<br />
 
 
 
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-
 
 
 
 
 
[[File:Soundevent examples.JPG|500px]]
 
 
 
 
 
'''''name''''' <br />
 
Replace 'soundname_01/02' with the name for your soundevent, this is what you will reference elsewhere in the tools to call your sound.
 
 
 
'''''type'''''  <br />
 
Replacing 'soundtype' inside the quotations with one of the two types explained below will determine the playback behavior of the sound.
 
 
 
'''''volume'''''  <br />
 
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.
 
 
 
'''''pitch'''''  <br />
 
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.
 
 
 
'''''delay'''''  <br />
 
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.
 
 
 
'''''vsnd_files'''''  <br />
 
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.  <br />
 
 
 
<br />''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''.
 
<br />
 
 
 
 
 
===== Types =====
 
 
 
There are 2 'type' settings you can use for sound behavior control in Destinations.
 
 
 
'''"destinations.simple_vr"''' <br /> 
 
For sounds with positional information and that require a falloff of volume against distance. Example usages - a bird call, dog bark, door closing.
 
 
 
'''"destinations.simple_2d"'''  <br />
 
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.
 
 
 
[[Category:Destinations]]
 

Latest revision as of 15:44, 23 June 2019