Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Plays the specified sound by SoundKitID.

willPlay, soundHandle = PlaySound(soundKitID [, channel, forceNoDuplicates, runFinishCallback])

Arguments[]

soundKitID
number - Sound Kit ID in SoundKitEntry.db2. Sounds used in FrameXML are defined in the SOUNDKIT table.
channel
string? = SFX - The sound channel.
Channel Toggle CVar Volume CVar[1]
Master Sound_EnableAllSoundSound_EnableAllSound (Sound)
Default: 1
Sound_MasterVolumeSound_MasterVolume (Sound)
Default: 1.0
master volume (0.0 to 1.0)
Music Sound_EnableMusicSound_EnableMusic (Sound)
Default: 1
Enables music
Sound_MusicVolumeSound_MusicVolume
Default: 0.4
SFX (Effects) Sound_EnableSFXSound_EnableSFX (Sound)
Default: 1
Sound_SFXVolumeSound_SFXVolume (Sound)
Default: 1.0
sound volume (0.0 to 1.0)
Ambience Sound_EnableAmbienceSound_EnableAmbience (Sound)
Default: 1
Enable Ambience
Sound_AmbienceVolumeSound_AmbienceVolume
Default: 0.6
Dialog Sound_EnableDialogSound_EnableDialog (Sound)
Default: 1
all dialog
Sound_DialogVolumeSound_DialogVolume (Sound)
Default: 1.0
Dialog Volume (0.0 to 1.0)
Talking Head[2]
API PlaySoundFile channels

Volume sliders in the interface options

forceNoDuplicates
boolean? = true - Allows duplicate sounds if false.
runFinishCallback
boolean? = false - Fires SOUNDKIT_FINISHED when the sound has finished playing, arg1 will be soundHandle.

Returns[]

willPlay
boolean - true if the sound will be played, nil otherwise (prevented by a muted sound channel, for instance).
soundHandle
number - identifier for the queued playback.

Example[]

Plays the ready check sound file (sound/interface/levelup2.ogg)

PlaySound(SOUNDKIT.READY_CHECK) -- by SOUNDKIT key
PlaySound(8960)                 -- by SoundKitID
PlaySoundFile(567478) -- by FileDataID

Details[]

  • Sound Kit IDs are used to play a set of random sounds. For example the human female NPC greeting sound kit refers to 5 different sounds.
/run PlaySound(5980)

-- will play one of these sounds
/run PlaySoundFile(552133) -- sound/creature/humanfemalestandardnpc/humanfemalestandardnpcgreeting01.ogg
/run PlaySoundFile(552141) -- sound/creature/humanfemalestandardnpc/humanfemalestandardnpcgreeting02.ogg
/run PlaySoundFile(552137) -- sound/creature/humanfemalestandardnpc/humanfemalestandardnpcgreeting03.ogg
/run PlaySoundFile(552142) -- sound/creature/humanfemalestandardnpc/humanfemalestandardnpcgreeting04.ogg
/run PlaySoundFile(552144) -- sound/creature/humanfemalestandardnpc/humanfemalestandardnpcgreeting05.ogg

Finding Sound IDs[]

File Data IDs

Sound Kit Names/IDs

Patch changes[]

Legion Patch 7.3.0 (2017-08-29): Changed. String-based input is not allowed. SoundKitID should be given while calling PlaySound(). This change is more like a replacement for PlaySoundKitID.
Legion Patch 7.0.3 (2016-07-19): Added fourth argument, runFinishCallback.
Mists of Pandaria Patch 5.0.4 (2012-08-28): Added willPlay and soundHandle return values.

See also[]

Advertisement