WoW:API PlaySoundFile: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
Plays the specified audio file once. Unlike [[API PlayMusic|PlayMusic]], you cannot stop the playback.
PlaySoundFile("path")


PlaySoundFile(SoundFile)
== Arguments ==
 
;path : String – The path and name of the sound file you'd like to play, relative to the WoW directory; both wav and mp3 formats are accepted. The file must exist prior to logging in to WoW.
Play the specified sound file.  The file will be played once. Unlike [[API PlayMusic|PlayMusic]], you cannot stop the file from playing once it starts.
 
----
;''Arguments''
 
<!-- List each argument, together with its type -->
 
:(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''


== Examples ==
You can play a sound file included with your addon:
  PlaySoundFile("Interface\\AddOns\\MyAddOn\\mysound.wav")
  PlaySoundFile("Interface\\AddOns\\MyAddOn\\mysound.wav")
Or one of the ones shipped with WoW ([[Power of the Horde]], in this case):
PlaySoundFile("Sound\\Music\\ZoneMusic\\DMF_L70ETC01.mp3")


or
== Notes ==
 
* 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.
PlaySoundFile("Interface\\AddOns\\MyAddOn\\mysound.mp3")
* This API call was broken in patch 1.11 and was fixed in patch 1.11.2.
 
----
;''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.
 
This API call was broken in patch 1.11 and was fixed in patch 1.11.2.
 
== Some Popular Sounds ==
*"[[Power of the Horde]]"
 
/script PlaySoundFile("Sound\\Music\\ZoneMusic\\DMF_L70ETC01.mp3")
 
*"[[Lament of the Highborne]]"
 
/script PlaySoundFile("Sound\\Music\\GlueScreenMusic\\BCCredits_Lament_of_the_Highborne.mp3")
 
* {{item|icon=|Corrupted Ashbringer}} "[[Corrupted_Ashbringer#Will_of_the_Ashbringer|Whispers]]"
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_01.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_02.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_03.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_04.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_05.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_06.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_07.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_08.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_09.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_10.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_11.wav")
/script PlaySoundFile("Sound\\Creature\\Ashbringer\\ASH_SPEAK_12.wav")
 
*[[Shade of Aran]] Emotes
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranAggro01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranAggro02.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranAggro03.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranArcane01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranArcane02.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranDies01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranFire01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranFire02.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranFrost01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranFrost02.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranGameOver01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranOutOfMana01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranSeeStaff01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranSlay01.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranSlay02.wav")
/script PlaySoundFile("Sound\\Creature\\ShadeOfAran\\AranSummonElem01.wav")


== See also ==
== See also ==
=== PlaySoundFile macro lists ===
* [[PlaySoundFile macros]] for a listing of audio files shipped with the game.
A gigantic (over one megabyte) list can be found at [[User talk:Parl2001#Here are your missing Soundfiles (removed) from that page|Parl2001]]'s talk page. This list was extracted from [[patch 2.4]], so some may have changed since then. Eventually these lists will hopefully get updated with {{wotlk-inline}} sounds.
 
This list is slowly being copied into separate pages:
* Instance sounds
** [[PlaySoundFile macros - Eastern Kingdoms instance sounds]]
** [[PlaySoundFile macros - Kalimdor instance sounds]]
** [[PlaySoundFile macros - Northrend instance sounds]]
** [[PlaySoundFile macros - Outland instance sounds]]
* Outdoor boss sounds
** [[PlaySoundFile macros - Eastern Kingdoms outdoor boss sounds]]
** [[PlaySoundFile macros - Kalimdor outdoor boss sounds]]
** [[PlaySoundFile macros - Northrend outdoor boss sounds]]
** [[PlaySoundFile macros - Outland outdoor boss sounds]]
* General mob sounds
** [[PlaySoundFile macros - Eastern Kingdoms general mob sounds]]
** [[PlaySoundFile macros - Kalimdor general mob sounds]]
** [[PlaySoundFile macros - Northrend general mob sounds]]
** [[PlaySoundFile macros - Outland general mob sounds]]
* Named mob sounds
** [[PlaySoundFile macros - Eastern Kingdoms named mob sounds]]
** [[PlaySoundFile macros - Kalimdor named mob sounds]]
** [[PlaySoundFile macros - Northrend named mob sounds]]
** [[PlaySoundFile macros - Outland named mob sounds]]
* General NPC sounds
** [[PlaySoundFile macros - Eastern Kingdoms general NPC sounds]]
** [[PlaySoundFile macros - Kalimdor general NPC sounds]]
** [[PlaySoundFile macros - Northrend general NPC sounds]]
** [[PlaySoundFile macros - Outland general NPC sounds]]
* Named NPC sounds
** [[PlaySoundFile macros - Eastern Kingdoms named NPC sounds]]
** [[PlaySoundFile macros - Kalimdor named NPC sounds]]
** [[PlaySoundFile macros - Northrend named NPC sounds]]
** [[PlaySoundFile macros - Outland named NPC sounds]]
*Uncategorized location sounds
** [[PlaySoundFile macros - other sounds]]
** [[PlaySoundFile macros - other doodad sounds]]
** [[PlaySoundFile macros - other item sounds]]
** [[PlaySoundFile macros - other music sounds]]
** [[PlaySoundFile macros - other spells sounds]]
*Player character sounds
** [[PlaySoundFile macros - Alliance player character sounds]]
** [[PlaySoundFile macros - Horde player character sounds]]
 
== External links ==
=== Updated for Wrath of the Lich King ===
{{elink|prefix=Not from Blizzard:&nbsp;|type=wowus|site=UI &amp; Macros forum|link=http://forums.worldofwarcraft.com/thread.html?topicId=13392160837&sid=1&pageNo=1|desc='''0. /scripts for every sound! Wrath version :D''' <small>12/11/2008 03:12:47 AM PST</small> by [http://forums.worldofwarcraft.com/search.html?characterId=715807439&sid=1 Bluspacecow]}}
 
'''NOTE:''' ''WoWWiki and Wikia are not responsible for the contents of the files below, so you use them at your own risk.''
 
;ZIP file downloads of list
:http://www.2shared.com/file/4485501/325410ac/Wow_Script_Sounds__including_wrath_.html
:http://www.megaupload.com/?d=TZSCO14Y
:http://www.thevarden.net/files/Wow%20Script%20Sounds%20(including%20wrath).zip
 
;AddOns
:{{elink|icon=wowi|site=WoWInterface.com|link=http://www.wowinterface.com/downloads/info9542-BossYells.html|desc=BossYells download}}
:{{elink|icon=wowi|site=WoWInterface.com|link=http://www.wowinterface.com/downloads/info10290-EndeavoursBossTalk.html|desc=EndeavoursBossTalk download}}

Revision as of 12:44, 29 March 2009

WoW API < PlaySoundFile

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

PlaySoundFile("path")

Arguments

path
String – The path and name of the sound file you'd like to play, relative to the WoW directory; both wav and mp3 formats are accepted. The file must exist prior to logging in to WoW.

Examples

You can play a sound file included with your addon:

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

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

PlaySoundFile("Sound\\Music\\ZoneMusic\\DMF_L70ETC01.mp3") 

Notes

  • 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.

See also