Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API PlaySoundFile

From Wowpedia
Jump to: navigation, search

Plays the specified audio file once.

willPlay, soundHandle = PlaySoundFile("soundFile" or soundFileID [, "channel"])


string - The path and name of the sound file you'd like to play, relative to the WoW directory;
  • Must be a path to a soundfile in an addon. The file must exist prior to logging in to WoW.
  • Both .ogg and .mp3 formats are accepted.
or soundFileID 
number - FileDataID of the sound.
string (optional) - The sound volume slider setting the sound should use, one of: Master, SFX, Music, Ambience, Dialog. Individual channels (except "Master") have user-configurable volume settings and may be muted, preventing playback. Defaults to SFX (Sound) if not specified.
Sound channels


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


Plays a sound file included with your addon and ignores any sound setting except the master volume slider:

  • Both slash / or escaped backslashes \\ can be used as file separators.
PlaySoundFile("Interface\\AddOns\\MyAddOn\\mysound.ogg", "Master")

Plays the level up sound:

-- by file path (dropped in 8.2.0)
-- by FileDataID 569593 (added support in 8.2.0)
-- by SoundKitID 888 (SoundKitName LEVELUP)

Finding Sound IDs

File Data IDs

Sound Kit Names/IDs

Patch changes

  • Battle for Azeroth Patch 8.2.0 (2019-06-25): Updated to accept FileDataIDs due to the removal of file paths. [1]
  • WoW Icon update.png Patch 1.2.0 (2004-12-18): Added.

See also