WoW:API PlaySoundFile: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(added the link reference and promise of repair)
Line 15: Line 15:


:(SoundFile)
:(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. As of patch 1.11, custom sound files are not playing properly.
:;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. As of patch 1.11, custom sound files are not playing properly.  In [http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=398491&p=1&tmp=1#post398491 this thread], Slouken states that a repair is intended.


----
----

Revision as of 00:23, 23 June 2006

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. As of patch 1.11, custom sound files are not playing properly. In this thread, Slouken states that a repair is intended.

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.

However - it does appear that the sound file must be present in the AddOn directory BEFORE loading the game. A /console reloadui will not refresh the sound files.

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.


Template:WoW API