API PlaySoundFile

104,670pages on
this wiki
Add New Page
Talk16 Share
WoW API < PlaySoundFile

Plays the specified audio file once. Unlike PlayMusic, you cannot stop the playback.

PlaySoundFile("path"[, "channel"])

Arguments Edit

String – The path and name of the sound file you'd like to play, relative to the WoW directory; both ogg and mp3 formats are accepted. The file must exist prior to logging in to WoW.
String – Either "Master" (this will play the sound also with disabled sounds like before 4.0.1), "SFX", "Ambience", "Music".

Examples Edit

You can play a sound file included with your addon:


Or one of the ones shipped with WoW (Power of the Horde, in this case):


Notes Edit

  • There does not appear to be a bad error if the file is missing - it just won't play. There is a return status, which is 1 if the sound was OK and nil if it couldn't be found.
  • This API call was broken in patch 1.11 and was fixed in patch 1.11.2.
  • As of 4.0.1, custom .wav files are no longer supported.

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki