Modding:Audio

From Stardew Valley Wiki
Jump to navigation Jump to search

Index

This page explains how to use and edit the game's music tracks and sound effects (called cues). This is an advanced guide for modders.

Audio data

You can add or edit cues by editing the Data/AudioChanges asset. New cues are added to the game's soundbank, so they can be used anywhere normal audio can be used (e.g. the Music map property).

Data format

The Data/AudioChanges asset consists of a string → model lookup, where the key matches the ID, and the value is a model with the fields below.

Entries in this asset describe an override applied to the soundbank. The override is applied permanently for the current game session, even if the asset is edited to remove it. Overriding a cue will reset all values to the ones specified.

field effect
ID The unique string ID for the audio cue, used when playing the sound in-game.
FilePaths A list of absolute file paths (not asset names) from which to load the audio. Each file can be .ogg or .wav. If you list multiple paths, a random one will be chosen each time it's played.
Category The audio category, which determines which volume slider in the game options applies. This should be one of Default, Music, Sound, Ambient, or Footsteps (see a description of each category). Defaults to Default.
StreamedVorbis Whether the audio should be streamed from disk when it's played, instead of being loaded into memory ahead of time. This is only possible for Ogg Vorbis (.ogg) files, which otherwise will be decompressed in-memory on load. Default false.

This is a tradeoff between memory usage and performance, so you should consider which value is best for each audio cue:

value effect
true Reduces memory usage when the audio cue isn't active, but increases performance impact when it's played. Playing the audio multiple times will multiply the memory and performance impact while they're active, since each play will stream a new instance. Recommended for longer audio cues (like music or ambient noise), or cues that are rarely used in a specific scenario (e.g. a sound that only plays once in an event).
false Increases memory usage (since it's fully loaded into memory), but reduces performance impact when it's played. It can be played any number of times without affecting memory or performance (it'll just play the cached audio). Recommended for sound effects, or short audio cues that are played occasionally.
Looped Whether the audio cue loops continuously until stopped. Default false.
UseReverb Whether to apply a reverb effect to the audio. Default false.
CustomFields The custom fields for this entry.

Category list

Each audio cue is assigned to one of five categories, which affects which volume slider in the game options applies to it:

internal ID name description
1 Default This is an unused category, and should generally be avoided.
2 Music For music tracks, to be regulated with the in-game music volume option.
3 Sound For sound effects, to be regulated with the in-game sound volume option.
4 Ambient For ambient background sounds, like wind, rain or machine whirring, that can play in the background of a scene.
5 Footsteps For step sounds, such as player or horse footsteps.

Audio file format

The game only supports .ogg and .wav formats. If you have .mp3 files you'd like to use in-game, you can convert the audio file to .wav or .ogg with audio software such as Audacity. For smaller-sized sounds such as sound effects, you can use a .wav file, but for audio such as music that has a large file size, use a compressed .ogg file.

Make sure the file size of your music is relatively small (preferably around 2-4MB). The bigger the file, the longer the game will freeze for when loading your newly added song. To reduce the size of your song, you can convert it to .ogg and add compression to the sound file. The more compression your audio has, the smaller the file will be, but the quality will diminish noticeably if you compress the audio too much.

If you're patching many sounds at once, keep the file size of your mod in mind, because the more sounds you include, the longer it will take for people to download your mod.

Example

This content pack adds a new music cue to the game, and plays it when the player enters the bus stop:

{
    "Format": "2.3.0",
    "Changes": [
        // add music cue
        {
            "Action": "EditData",
            "Target": "Data/AudioChanges",
            "Entries": {
                "{{ModId}}_Music": {
                    "ID": "{{ModId}}_Music",
                    "Category": "Music",
                    "FilePaths": [ "{{AbsoluteFilePath: assets/music.ogg}}" ],
                    "StreamedVorbis": true,
                    "Looped": true
                }
            }
        },

        // add to bus stop
        {
            "Action": "EditMap",
            "Target": "Maps/BusStop",
            "MapProperties": {
                "Music": "{{ModId}}_Music"
            }
        }
    ]
}

Review audio

Unpack audio files

The base game's audio is stored in the Content/XACT folder in the form of soundbanks, which store all of the game's sounds and music. The two soundbank files available are Wave Bank(1.4).xwb and Wave Bank.xwb.

Audio files can be extracted and browsed with an XWB extractor:

tool name platforms supported notes
unxwb Windows, macOS Extracts an XWB soundbank into .wav files and hex codes. A straightforward open and extract utility.
use unwxnb on macOS 
If you want to use unxwb on a Mac, you'll need to build it yourself.
  1. Download the source code to unxwb from unxwb (click the green Code button > select download zip)
  2. Download this make file from Github (download zip button in top right)
  3. Unzip both if needed
  4. Move the make file into the source code folder
  5. Open up Terminal and type cd Downloads/unxwb-master and hit return if you just left everything in Downloads, or otherwise use cd to move into the folder with the source code
  6. Type make into Terminal and hit return. If this gives you errors, try typing in xcode-select --install and hit return, which installs developer tools, and then try make again
  7. You should now have unxwb as a Unix executable file in that folder
  8. Copy Wave Bank.xwb from your game content folder into the folder
  9. Type ./unxwb Wave\ Bank.xwb and hit return to extract the .wavs from the .xwb
  10. Move the .wav files into a separate folder (I named mine Wave Bank)
  11. Copy Wave Bank(1.4).xwb from your game content folder into the folder
  12. Rename Wave Bank(1.4).xwb to WaveBank14.xwb
  13. Type ./unxwb WaveVank14.xwb and hit return to extract the .wavs from the .xwb
  14. Move the .wav files into a separate folder (I named mine Wave Bank 1.4)
  15. Now you have all the .wavs into two folders!
VGMStream plugin for foobar2000 sound player Windows Views XWB soundbanks with integer codes and many in-game codes included in filenames, and has a very convenient file browser. (For some reason, it increments audio IDs by 1, and each audio cue is looped.)
XACTTool Windows Extracts an XWB soundbank into .wav files and integer codes. Can also manipulate soundbanks. Command-line only.

See the full track list below.

Identify audio in-game

  • For music tracks, you can install the Now Playing mod (see the mod description for info on adding the music ID to the message). A HUD message will be shown in-game when music starts.
  • For sound effects, you can enter debug logSounds in the SMAPI console window. This will log info for each sound played in-game, including positional data if applicable. See console commands for more info.

Track list

These are the raw soundbank IDs for music and sounds exported from the game data (see the talk page for the export code).

A few notes about the table columns:

  • The name is what you'd use in-game (e.g., with the Music map property or the Game1.changeMusicTrack method). When a name is repeated with different soundbank IDs, the game will choose a random sound each time you play it.
  • The wavebank indicates whether the audio is from Content/XACT/Wave Bank.xwb or Content/XACT/Wave Bank(1.4).xwb. Each wavebank has its own set of soundbank IDs, but names don't overlap.
  • The soundtrack index is the sound's position in the soundbank. The hexadecimal version matches the track's filename if you unpack the wavebank using unxwb.
  • The description column is filled in manually for the wiki.

See also an older spreadsheet with more comprehensive descriptions. (Don't copy text from that spreadsheet into this page, since it's not licensed!)

Footsteps

name wavebank soundbank index description
decimal hexadecimal
Cowboy_Footstep Wavebank 269 0000010d Mainly used as the footstep sound for pets, in Prairie King, and as a hover sound in various menus (including the title screen buttons).
grassyStep Wavebank 22 00000016 Mainly used as the player footstep sound on grass tiles, when adding hay to a silo, when changing a player's hat or hairstyle, and for rustling bushes in Lewis and Marnie's six-heart event.
sandyStep Wavebank 16 00000010 A quiet, shuffling noise. Plays when new clothes are put on the farmer.
snowyStep Wavebank 340 00000154
stoneStep Wavebank 23 00000017 Plays when the player selects an inventory slot or places an item in their inventory.
thudStep Wavebank 24 00000018
woodyStep Wavebank 29 0000001d

Music

name wavebank soundbank index description
decimal hexadecimal
50s Wavebank 45 0000002d
AbigailFlute Wavebank 279 00000117
AbigailFluteDuet Wavebank 280 00000118
aerobics Wavebank 55 00000037
archaeo Wavebank 0 00000000
bigDrums Wavebank 172 000000ac
breezy Wavebank 281 00000119
caldera Wavebank 383 0000017f
Cavern Wavebank 65 00000041
christmasTheme Wavebank 305 00000131
Cloth Wavebank 67 00000043
CloudCountry Wavebank 190 000000be
clubloop Wavebank 102 00000066
cowboy_boss Wavebank 267 0000010b
cowboy_outlawsong Wavebank 277 00000115
Cowboy_OVERWORLD Wavebank 261 00000105
Cowboy_singing Wavebank 262 00000106
Cowboy_undead Wavebank 270 0000010e
crane_game Wavebank(1.4) 12 0000000c
crane_game_fast Wavebank(1.4) 13 0000000d
Crystal Bells Wavebank 64 00000040
Cyclops Wavebank 124 0000007c
desolate Wavebank 40 00000028
distantBanjo Wavebank 347 0000015b
EarthMine Wavebank 64 00000040
EarthMine Wavebank 65 00000041
EarthMine Wavebank 66 00000042
echos Wavebank 49 00000031
elliottPiano Wavebank 295 00000127
EmilyDance Wavebank 357 00000165
EmilyDream Wavebank 358 00000166
EmilyTheme Wavebank 359 00000167
end_credits Wavebank 403 00000193
event1 Wavebank 299 0000012b
event2 Wavebank 302 0000012e
fall1 Wavebank 121 00000079
fall2 Wavebank 119 00000077
fall3 Wavebank 120 00000078
fallFest Wavebank 304 00000130
fieldofficeTentMusic Wavebank 375 00000177
FlowerDance Wavebank 301 0000012d
FrogCave Wavebank 387 00000183
FrostMine Wavebank 67 00000043
FrostMine Wavebank 68 00000044
FrostMine Wavebank 69 00000045
Ghost Synth Wavebank 119 00000077
grandpas_theme Wavebank 336 00000150
gusviolin Wavebank 297 00000129
harveys_theme_jazz Wavebank(1.4) 4 00000004
heavy Wavebank 51 00000033
honkytonky Wavebank 52 00000034
Icicles Wavebank 68 00000044
IslandMusic Wavebank 374 00000176
jaunty Wavebank 41 00000029
junimoKart Wavebank(1.4) 20 00000014
junimoKart_ghostMusic Wavebank(1.4) 0 00000000
junimoKart_mushroomMusic Wavebank(1.4) 21 00000015
junimoKart_slimeMusic Wavebank(1.4) 22 00000016
junimoKart_whaleMusic Wavebank(1.4) 1 00000001
junimoStarSong Wavebank 308 00000134
kindadumbautumn Wavebank 282 0000011a
LavaMine Wavebank 72 00000048
LavaMine Wavebank 73 00000049
LavaMine Wavebank 198 000000c6
LavaMine Wavebank 215 000000d7
libraryTheme Wavebank 341 00000155
MainTheme Wavebank 335 0000014f
Majestic Wavebank 121 00000079
MarlonsTheme Wavebank 349 0000015d
marnieShop Wavebank 180 000000b4
mermaidSong Wavebank 362 0000016a
moonlightJellies Wavebank 303 0000012f
movie_classic Wavebank(1.4) 7 00000007
movie_nature Wavebank(1.4) 8 00000008
movie_wumbus Wavebank(1.4) 9 00000009
movieTheater Wavebank(1.4) 10 0000000a
movieTheaterAfter Wavebank(1.4) 11 0000000b
musicboxsong Wavebank 44 0000002c
Near The Planet Core Wavebank 72 00000048
New Snow Wavebank 126 0000007e
night_market Wavebank 364 0000016c
Of Dwarves Wavebank 73 00000049
Orange Wavebank 122 0000007a
Overcast Wavebank 215 000000d7
Pink Petals Wavebank 93 0000005d
PIRATE_THEME Wavebank 390 00000186
PIRATE_THEME(muffled) Wavebank 390 00000186
playful Wavebank 278 00000116
Plums Wavebank 120 00000078
poppy Wavebank 53 00000035
ragtime Wavebank 46 0000002e
sad_kid Wavebank 389 00000185
sadpiano Wavebank 47 0000002f
Saloon1 Wavebank 350 0000015e
sam_acoustic1 Wavebank(1.4) 2 00000002
sam_acoustic2 Wavebank(1.4) 3 00000003
sampractice Wavebank 50 00000032
sappypiano Wavebank 43 0000002b
Secret Gnomes Wavebank 66 00000042
SettlingIn Wavebank 192 000000c0
shaneTheme Wavebank 361 00000169
shimmeringbastion Wavebank 54 00000036
spaceMusic Wavebank 285 0000011d
spirits_eve Wavebank 334 0000014e
spring1 Wavebank 93 0000005d
spring2 Wavebank 91 0000005b
spring3 Wavebank 92 0000005c
springsongs Wavebank 91 0000005b
springsongs Wavebank 92 0000005c
springsongs Wavebank 93 0000005d
springtown Wavebank 94 0000005e
Stadium_ambient Wavebank 356 00000164
starshoot Wavebank 42 0000002a
submarine_song Wavebank 366 0000016e
summer1 Wavebank 122 0000007a
summer2 Wavebank 123 0000007b
summer3 Wavebank 115 00000073
SunRoom Wavebank(1.4) 17 00000011
sweet Wavebank 144 00000090
tickTock Wavebank 300 0000012c
tinymusicbox Wavebank 296 00000128
title_night Wavebank 127 0000007f
tribal Wavebank 198 000000c6
Tropical Jam Wavebank 115 00000073
VolcanoMines Wavebank 382 0000017e
VolcanoMines Wavebank 384 00000180
VolcanoMines1 Wavebank 382 0000017e
VolcanoMines2 Wavebank 384 00000180
wavy Wavebank 95 0000005f
wedding Wavebank 104 00000068
winter1 Wavebank 126 0000007e
winter2 Wavebank 124 0000007c
winter3 Wavebank 125 0000007d
WizardSong Wavebank 321 00000141
woodsTheme Wavebank 216 000000d8
XOR Wavebank 69 00000045

Music (ambient)

name wavebank soundbank index description
decimal hexadecimal
babblingBrook Wavebank 343 00000157
bugLevelLoop Wavebank 169 000000a9
communityCenter Wavebank 307 00000133
cracklingFire Wavebank 342 00000156
darkCaveLoop Wavebank 168 000000a8
fall_day_ambient Wavebank 338 00000152
Frost_Ambient Wavebank 200 000000c8
heavyEngine Wavebank 344 00000158
Hospital_Ambient Wavebank 283 0000011b
jojaOfficeSoundscape Wavebank 337 00000151
jungle_ambience Wavebank 371 00000173
Lava_Ambient Wavebank 201 000000c9
movieScreenAmbience Wavebank(1.4) 6 00000006
nightTime Wavebank 224 000000e0
ocean Wavebank 175 000000af
pool_ambient Wavebank 288 00000120
rain Wavebank 116 00000074
roadnoise Wavebank 189 000000bd
spring_day_ambient Wavebank 179 000000b3
spring_night_ambient Wavebank 345 00000159
summer_day_ambient Wavebank 339 00000153
tropical_island_day_ambient Wavebank 376 00000178
Upper_Ambient Wavebank 199 000000c7
Volcano_Ambient Wavebank 377 00000179
wind Wavebank 85 00000055
winter_day_ambient Wavebank 354 00000162

Sound

name wavebank soundbank index description
decimal hexadecimal
achievement Wavebank 103 00000067
axchop Wavebank 141 0000008d
axe Wavebank 1 00000001
backpackIN Wavebank 133 00000085
barrelBreak Wavebank 310 00000136
batFlap Wavebank 170 000000aa
batScreech Wavebank 171 000000ab
bigDeSelect Wavebank 2 00000002
bigSelect Wavebank 3 00000003
bob Wavebank 30 0000001e
boop Wavebank 98 00000062
boop Wavebank 99 00000063
boop Wavebank 100 00000064
boop Wavebank 101 00000065
boulderBreak Wavebank 238 000000ee
boulderCrack Wavebank 4 00000004
breakingGlass Wavebank 284 0000011c
breathin Wavebank 84 00000054
breathout Wavebank 83 00000053
bubbles Wavebank 235 000000eb
bubbles Wavebank 236 000000ec
busDoorOpen Wavebank 191 000000bf
busDriveOff Wavebank 309 00000135
button1 Wavebank 250 000000fa A high-pitched "click-click" noise. Plays when bobbers are attached to fishing rods.
cacklingWitch Wavebank 323 00000143
camel Wavebank(1.4) 23 00000017
cameraNoise Wavebank 292 00000124
cancel Wavebank 353 00000161
cast Wavebank 246 000000f6
cat Wavebank 332 0000014c
cat Wavebank 333 0000014d
cavedrip Wavebank 129 00000081 A wet 'dwoop' sound. Used as random background noise in the mines and sewers, and the dripping sound for the volcano dungeon entrance pipe.
clam_tone Wavebank 363 0000016b
clank Wavebank 173 000000ad
clank Wavebank 203 000000cb
clank Wavebank 203 000000cb
clank Wavebank 204 000000cc
clank Wavebank 205 000000cd
clank Wavebank 205 000000cd
clubhit Wavebank 159 0000009f
clubSmash Wavebank 174 000000ae
clubswipe Wavebank 160 000000a0
cluck Wavebank 31 0000001f
cluck Wavebank 32 00000020
cluck Wavebank 33 00000021
coin Wavebank 5 00000005
coldSpell Wavebank 197 000000c5
cow Wavebank 80 00000050
cow Wavebank 81 00000051
cow Wavebank 82 00000052
cowboy_dead Wavebank 268 0000010c
cowboy_explosion Wavebank 276 00000114
cowboy_gopher Wavebank 275 00000113
cowboy_gunload Wavebank 272 00000110
Cowboy_gunshot Wavebank 266 0000010a A short, hollow 'tock' sound. Used for woodpeckers pecks, Journey of the Prairie King guns, darts impact, casino slots, and a hover sound in many in-game menus.
Cowboy_monsterDie Wavebank 264 00000108
Cowboy_monsterDie Wavebank 265 00000109
cowboy_monsterhit Wavebank 274 00000112
cowboy_powerup Wavebank 271 0000010f
Cowboy_Secret Wavebank 263 00000107
crafting Wavebank 36 00000024
crane Wavebank(1.4) 14 0000000e
crickets Wavebank 117 00000075
cricketsAmbient Wavebank 346 0000015a
crit Wavebank 352 00000160
croak Wavebank 138 0000008a
crow Wavebank 324 00000144
crystal Wavebank 143 0000008f A high-pitched 'ding!' sound that resonates for a few seconds. Used for the mine elevator ding, island crystal puzzle, in dialogue for the < character, Singing Stone (with a random pitch), and mine crystals when broken.
cut Wavebank 6 00000006
daggerswipe Wavebank 163 000000a3
death Wavebank 70 00000046
debuffHit Wavebank 151 00000097
debuffSpell Wavebank 152 00000098
detector Wavebank 37 00000025
dialogueCharacter Wavebank 7 00000007
dialogueCharacterClose Wavebank 8 00000008
dirtyHit Wavebank 243 000000f3
dirtyHit Wavebank 244 000000f4
discoverMineral Wavebank 208 000000d0
distantTrain Wavebank 220 000000dc
distantTrain Wavebank 221 000000dd
dog_bark Wavebank 331 0000014b
dog_pant Wavebank 330 0000014a
dogs Wavebank 228 000000e4
dogWhining Wavebank 316 0000013c
doorClose Wavebank 9 00000009
doorCreak Wavebank 319 0000013f
doorCreakReverse Wavebank 322 00000142
doorOpen Wavebank 320 00000140
dropItemInWater Wavebank 10 0000000a
drumkit0 Wavebank 110 0000006e
drumkit1 Wavebank 111 0000006f
drumkit2 Wavebank 108 0000006c
drumkit3 Wavebank 107 0000006b
drumkit4 Wavebank 109 0000006d
drumkit5 Wavebank 106 0000006a
drumkit6 Wavebank 105 00000069 Plays when checkboxes in the settings menu are toggled.
Duck Wavebank 231 000000e7
Duggy Wavebank 60 0000003c
dustMeep Wavebank 186 000000ba
DwarvishSentry Wavebank 386 00000182
dwoop Wavebank 34 00000022
dwop Wavebank 234 000000ea A sound that inflects upwards in pitch. Plays when the user clicks on an item in their inventory to lift it up and freely drag it around, when the trash bear throws an item up into the air, when bobbers are removed from fishing rods, etc.
eat Wavebank 25 00000019
explosion Wavebank 35 00000023
fallDown Wavebank 318 0000013e
fastReel Wavebank 248 000000f8
fireball Wavebank 71 00000047
fishBite Wavebank 26 0000001a
fishBite_alternate_0 Wavebank 398 0000018e
fishBite_alternate_1 Wavebank 397 0000018d
fishBite_alternate_2 Wavebank 396 0000018c
fishEscape Wavebank 253 000000fd
FishHit Wavebank 251 000000fb
fishingRodBend Wavebank 254 000000fe
fishingRodBend Wavebank 255 000000ff
fishingRodBend Wavebank 256 00000100
fishSlap Wavebank 260 00000104
flameSpell Wavebank 150 00000096
flameSpellHit Wavebank 149 00000095
flute Wavebank 112 00000070
flybuzzing Wavebank 164 000000a4
frozen Wavebank 394 0000018a
furnace Wavebank 38 00000026
fuse Wavebank 48 00000030
getNewSpecialItem Wavebank 223 000000df
ghost Wavebank 11 0000000b
give_gift Wavebank 348 0000015c
glug Wavebank 325 00000145
goat Wavebank 78 0000004e
goat Wavebank 79 0000004f
goldenWalnut Wavebank 372 00000174
gorilla_intro Wavebank 388 00000184
grunt Wavebank 12 0000000c
gulp Wavebank 239 000000ef
gulp Wavebank 240 000000f0
hammer Wavebank 134 00000086
harvest Wavebank 326 00000146
healSound Wavebank 196 000000c4
hitEnemy Wavebank 56 00000038
hoeHit Wavebank 13 0000000d
horse_flute Wavebank 395 0000018b
horse_flute Wavebank 401 00000191
horse_flute Wavebank 402 00000192
jingle1 Wavebank 252 000000fc A high-pitched "ding". Used when a fish is caught and when journal or fish pond quests are completed.
junimoKart_coin Wavebank(1.4) 16 00000010
junimoMeep1 Wavebank 306 00000132
keyboardTyping Wavebank 293 00000125
killAnimal Wavebank 233 000000e9
leafrustle Wavebank 142 0000008e
magma_sprite_die Wavebank 380 0000017c
magma_sprite_hit Wavebank 379 0000017b
magma_sprite_spot Wavebank 381 0000017d
Meteorite Wavebank 225 000000e1
Milking Wavebank 230 000000e6
minecartLoop Wavebank 188 000000bc
miniharp_note Wavebank(1.4) 5 00000005
money Wavebank 61 0000003d
moneyDial Wavebank 237 000000ed A high-pitched sound of coins falling. Plays repeatedly on a new day when the money from the previous day's shipping is added to the player's farm.
monkey1 Wavebank 385 00000181
monsterdead Wavebank 158 0000009e
mouseClick Wavebank 294 00000126
newArtifact Wavebank 211 000000d3 A low-pitched "ding". Plays when UI messages such as skill mastery level-ups appear, items are donated to bundles or the museum, the Night Market submarine reaches the ocean floor, breaking open a geode containing common items at the Blacksmith, and in other menus throughout the game.
newRecipe Wavebank 214 000000d6
newRecord Wavebank 213 000000d5
objectiveComplete Wavebank 132 00000084
openBox Wavebank 14 0000000e
openChest Wavebank 161 000000a1
Ostrich Wavebank 367 0000016f
ow Wavebank 63 0000003f
owl Wavebank 227 000000e3
parrot Wavebank 360 00000168
parrot_squawk Wavebank 373 00000175
parry Wavebank 173 000000ad
phone Wavebank 113 00000071
Pickup_Coin15 Wavebank 273 00000111
pickUpItem Wavebank 15 0000000f
pig Wavebank 130 00000082
pig Wavebank 131 00000083
potterySmash Wavebank 147 00000093
powerup Wavebank 39 00000027
pullItemFromWater Wavebank 28 0000001c
purchase Wavebank 145 00000091
purchase Wavebank 146 00000092
purchase Wavebank 241 000000f1
purchaseClick Wavebank 146 00000092
purchaseRepeat Wavebank 241 000000f1
qi_shop Wavebank 399 0000018f
qi_shop_purchase Wavebank 400 00000190
questcomplete Wavebank 128 00000080
quickSlosh Wavebank 290 00000122
quickSlosh Wavebank 291 00000123
rabbit Wavebank 74 0000004a
rainsound Wavebank 135 00000087
rainsound Wavebank 136 00000088
rainsound Wavebank 137 00000089
reward Wavebank 212 000000d4
robotBLASTOFF Wavebank 287 0000011f
robotSoundEffects Wavebank 286 0000011e
rockGolemDie Wavebank 166 000000a6
rockGolemHit Wavebank 167 000000a7
rockGolemSpawn Wavebank 165 000000a5
rooster Wavebank 329 00000149
scissors Wavebank 229 000000e5
seagulls Wavebank 176 000000b0
seagulls Wavebank 177 000000b1
seagulls Wavebank 178 000000b2
secret1 Wavebank 218 000000da
seeds Wavebank 17 00000011
select Wavebank 148 00000094 A high-pitched hollow rising 'pook!' sound. Used as a click/select sound in many menus (e.g. clicking a button on the title screen).
sell Wavebank 242 000000f2
serpentDie Wavebank 315 0000013b
serpentHit Wavebank 314 0000013a
sewing_loop Wavebank(1.4) 15 0000000f
shadowDie Wavebank 194 000000c2
shadowHit Wavebank 195 000000c3
shadowpeep Wavebank 18 00000012
sheep Wavebank 232 000000e8
shiny4 Wavebank 19 00000013
Ship Wavebank 96 00000060
Ship Wavebank 97 00000061
shwip Wavebank 317 0000013d
SinWave Wavebank 245 000000f5
sipTea Wavebank 193 000000c1
skeletonDie Wavebank 183 000000b7
skeletonHit Wavebank 184 000000b8
skeletonStep Wavebank 182 000000b6
slime Wavebank 57 00000039
slimedead Wavebank 59 0000003b
slimedead Wavebank 156 0000009c
slimedead Wavebank 157 0000009d
slimeHit Wavebank 185 000000b9
slingshot Wavebank 207 000000cf
slosh Wavebank 289 00000121
slosh Wavebank 290 00000122
slosh Wavebank 291 00000123
slowReel Wavebank 247 000000f7
smallSelect Wavebank 20 00000014
SpringBirds Wavebank 86 00000056
SpringBirds Wavebank 87 00000057
SpringBirds Wavebank 88 00000058
SpringBirds Wavebank 89 00000059
SpringBirds Wavebank 90 0000005a
squid_bubble Wavebank 392 00000188
squid_hit Wavebank 393 00000189
squid_move Wavebank 391 00000187
Stadium_cheer Wavebank 355 00000163
stairsdown Wavebank 313 00000139
stardrop Wavebank 351 0000015f
steam Wavebank 378 0000017a
stoneCrack Wavebank 75 0000004b
stoneCrack Wavebank 76 0000004c
stumpCrack Wavebank 217 000000d9
submarine_landing Wavebank 365 0000016d
swordswipe Wavebank 58 0000003a
swordswipe Wavebank 162 000000a2
telephone_buttonPush Wavebank 369 00000171
telephone_dialtone Wavebank 370 00000172
telephone_ringingInEar Wavebank 368 00000170
throw Wavebank 187 000000bb
throwDownITem Wavebank 21 00000015
thunder Wavebank 114 00000072
thunder_small Wavebank 327 00000147
thunder_small Wavebank 328 00000148
tinyWhip Wavebank 249 000000f9
toolCharge Wavebank 62 0000003e
toolSwap Wavebank 27 0000001b
toyPiano Wavebank 181 000000b5
trainLoop Wavebank 222 000000de
trainWhistle Wavebank 219 000000db
trashbear Wavebank(1.4) 25 00000019
trashbear_flute Wavebank(1.4) 24 00000018
trashcan Wavebank 209 000000d1
trashcanlid Wavebank 210 000000d2
treecrack Wavebank 140 0000008c
treethud Wavebank 139 0000008b
UFO Wavebank 226 000000e2
wand Wavebank 118 00000076
warrior Wavebank 206 000000ce
wateringCan Wavebank 153 00000099
wateringCan Wavebank 154 0000009a
wateringCan Wavebank 155 0000009b
waterSlosh Wavebank 257 00000101
waterSlosh Wavebank 258 00000102
waterSlosh Wavebank 259 00000103
whistle Wavebank 298 0000012a
woodchipper Wavebank(1.4) 18 00000012
woodchipper_occasional Wavebank(1.4) 19 00000013
woodWhack Wavebank 311 00000137
woodWhack Wavebank 312 00000138
woodyHit Wavebank 77 0000004d
yoba Wavebank 202 000000ca

Manage audio in C#

Play sound effects

The game mostly handles sound effects through the Game1.sounds field. This has low-level methods like PlayLocal, PlayAll, GetVolumeForDistance, etc.

However, you should rarely call Game1.sounds directly. Instead the game has four main methods for playing a sound effect:

method usage
Game1.playSound Play a sound for the current player only, which isn't synced in multiplayer and isn't affected by location or distance. This is mainly used for UI and menu sounds.

For example:

// for UI elements (e.g. crafting an item)
Game1.playSound("crafting");
GameLocation.localSound
GameLocation.playSound
Play a sound for the current player (localSound) or all players (playSound) if they're in this location.

You can optionally specify...

  • a tile position (which attenuates volume for each player based on their distance from the sound's source);
  • and/or pitch (from 0 to 2400 with intervals of 100 between every half step, where 1200 is the default pitch).

For example:

// play sound for the current player if they're anywhere on the farm
Game1.getFarm().localSound("doorCreak");

// play sound for the current player if they're on the farm near the mailbox (fading with distance)
Farm farm = Game1.getFarm();
farm.localSound("doorCreak", farm.GetMainMailboxPosition());

// play sound for all players on the farm near the mailbox (fading with distance), with a -200 pitch shift
Farm farm = Game1.getFarm();
farm.playSound("doorCreak", farm.GetMainMailboxPosition(), 1000);
DelayedAction.playSoundAfterDelay Play a sound for the current or all players after a specified delay in milliseconds. You can optionally specify a location, tile position, and pitch (which works the same way as the GameLocation methods). You can call this method repeatedly to play multiple sounds (e.g. for a sequence of sounds with different delays).

For example:

// play sound for the current player after 1.5 seconds, no matter where they are
DelayedAction.playSoundAfterDelay("thunder_small", 1500);

// play sound for all players on the farm after 1.5 seconds, fading with distance from the mailbox
Farm farm = Game1.getFarm();
DelayedAction.playSoundAfterDelay("doorCreak", farm, farm.GetMainMailboxPosition());

// play sound for the current player only if they'rte on the farm after 1.5 seconds, fading with distance from the mailbox
Farm farm = Game1.getFarm();
DelayedAction.playSoundAfterDelay("doorCreak", farm, farm.GetMainMailboxPosition(), local: true);

Add custom audio

TODO: update for custom audio in Stardew Valley 1.6

Game audio is split up into components:

  • The SoundEffect is the object that stores the sound audio itself.
  • The Cue is the object that stores the sound name, the SoundEffect, and any other settings or properties the sound has.
  • The Soundbank stores Cues to be called, played or modified.

To add your own audio to the soundbank (whether it's a new sound or a new music track), you can define a new CueDefinition and add a name:

CueDefinition myCueDefinition = new CueDefinition();

// Adding the name for the cue, which will be
// the name of the audio to play when using sound functions.
myCueDefinition.name = "myNewSound";

You can also make sure your audio will only be played with one instance at a time, to prevent two of the same audio clips from playing over each other.

// If this sound is played multiple times in quick succession,
// only one sound instance will play at a time.
myCueDefinition.instanceLimit = 1;
myCueDefinition.limitBehavior = CueDefinition.LimitBehavior.ReplaceOldest;

Then, add the audio file to the cue by creating a new SoundEffect, then fetching the audio file from a new FileStream and adding it to the SoundEffect.

// Get the audio file and add it to a SoundEffect.
SoundEffect audio;
string filePathCombined = Path.Combine(this.Helper.DirectoryPath, "mySound.wav");
using (var stream = new System.IO.FileStream(filePathCombined, System.IO.FileMode.Open)) {
    audio = SoundEffect.FromStream(stream);
}

Lastly, add the SoundEffect 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 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 Sound by calling the getter Game1.audioEngine.GetCategoryIndex():

// Setting the sound effect to the new cue.
myCueDefinition.SetSound(audio, Game1.audioEngine.GetCategoryIndex("Sound"), false);

// Adding the cue to the sound bank.
Game1.soundBank.AddCue(myCueDefinition);

If you just added a sound, you should now be able to play your audio using any of the sound commands!

Game1.playSound("myNewSound");

If you just added new music, you should now be able to add your music ID to any map.

Edit existing audio

TODO: update for custom audio in Stardew Valley 1.6

To modify a cue that exists in the game, you can declare it from an existing cue as a new cue definition, and invoke CueDefinition.SetSound to apply your new audio to the cue.

As mentioned above, set your new cue's category to be the same category which the cue is included in (ie. the sound debuffHit is located in the Sound category).

// Get the cue to manipulate.
var existingCueDef = Game1.soundBank.GetCueDefinition("debuffHit");

// Get the audio file and add it to a new SoundEffect, to replace the old one.
SoundEffect audio;
string filePathCombined = Path.Combine(this.Helper.DirectoryPath, "mySound.wav");
using (var stream = new System.IO.FileStream(filePathCombined, System.IO.FileMode.Open)) {
    audio = SoundEffect.FromStream(stream);
}

// Assign the new audio to this cue.
existingCueDef.SetSound(audio, audioEngine.GetCategoryIndex("Sound"), false);

See also