Line 295: |
Line 295: |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | Lastly, add the <samp>SoundEffect</samp> to the cue, and assign the cue to the soundbank to be stored. By setting the category index to the appropriate option, players can regulate the sound's volume with the in-game volume options (ie. sound effect or music volume sliders): | + | Lastly, add the <samp>SoundEffect</samp> to the cue, and assign the cue to the soundbank to be stored. We also need to set a category, which determines which volume slider in the game options applies (see [[#Category list|the category list]]). In this case, since the cue is meant to be played as a sound effect and not a music track, the cue's category is set to <samp>Sound</samp> by calling the getter <samp>Game1.audioEngine.GetCategoryIndex()</samp>: |
− | | |
− | {| class="wikitable"
| |
− | |-
| |
− | ! ID
| |
− | ! Name
| |
− | ! Use case
| |
− | |-
| |
− | | 1
| |
− | | <samp>Default</samp>
| |
− | | This is an unused category, and should generally be avoided.
| |
− | |-
| |
− | | 2
| |
− | | <samp>Music</samp>
| |
− | | For any music tracks, to be regulated with the in-game music volume option.
| |
− | |-
| |
− | | 3
| |
− | | <samp>Sound</samp>
| |
− | | For any sound effects, to be regulated with the in-game sound volume option.
| |
− | |-
| |
− | | 4
| |
− | | <samp>Ambient</samp>
| |
− | | For ambient background sounds, like wind, rain or machine whirring, that can play in the background of a scene.
| |
− | |-
| |
− | | 5
| |
− | | <samp>Footsteps</samp>
| |
− | | For any step sounds, such as player or horse footsteps.
| |
− | |}
| |
− | | |
− | In this case, since the cue is meant to be played as a sound effect and not a music track, the cue's category is set to <samp>Sound</samp> by calling the getter <samp>Game1.audioEngine.GetCategoryIndex()</samp>: | |
| | | |
| <syntaxhighlight lang="c#"> | | <syntaxhighlight lang="c#"> |
Line 3,183: |
Line 3,154: |
| | data-sort-value="202"| <samp>000000ca</samp> | | | data-sort-value="202"| <samp>000000ca</samp> |
| | | | | |
| + | |} |
| + | |
| + | ==Category list== |
| + | Each audio cue is assigned to one of five categories, which affects which volume slider in the game options applies to it: |
| + | |
| + | {| class="wikitable" |
| + | |- |
| + | ! internal ID |
| + | ! name |
| + | ! description |
| + | |- |
| + | | 1 |
| + | | <samp>Default</samp> |
| + | | This is an unused category, and should generally be avoided. |
| + | |- |
| + | | 2 |
| + | | <samp>Music</samp> |
| + | | For music tracks, to be regulated with the in-game music volume option. |
| + | |- |
| + | | 3 |
| + | | <samp>Sound</samp> |
| + | | For sound effects, to be regulated with the in-game sound volume option. |
| + | |- |
| + | | 4 |
| + | | <samp>Ambient</samp> |
| + | | For ambient background sounds, like wind, rain or machine whirring, that can play in the background of a scene. |
| + | |- |
| + | | 5 |
| + | | <samp>Footsteps</samp> |
| + | | For step sounds, such as player or horse footsteps. |
| |} | | |} |
| | | |