WoW:API PlaySoundFile

From AddOn Studio
Revision as of 00:13, 27 January 2005 by WoWWiki>Coder 1024
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
PlaySoundFile -Documentation by coder_1024 taken from Dhargo's post on the official forums-


PlaySoundFile(SoundFile);


Play the specified sound file. The file will be played once.


Arguments


(SoundFile)
SoundFile
String - The path and name of the sound file you'd like to play. This has been successfully tested with .wav and .mp3 files. Note that the path is relative to the World of Warcraft installation directory.

Example: Playing a sound file from within an AddOn's directory


PlaySoundFile("Interface\\AddOns\\MyAddOn\\mysound.wav");

or

PlaySoundFile("Interface\\AddOns\\MyAddOn\\mysound.mp3");

Details


This has been successfully tested for playing sounds inside your AddOn's directory, so you don't have to worry about putting your sound files outside your AddOn directory.


Template:WoW API