WoW API: PlayMusic

Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API PlayMusic to API PlayMusic without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < PlayMusic

Plays the given mp3 file.

PlayMusic(soundFile);

ParametersEdit

ArgumentsEdit

soundFile
String - path to a MP3 file. You can refer to both files in WoW's MPQs, or your own music files in your addon's directory.

ExampleEdit

PlayMusic("Sound\\Music\\GlueScreenMusic\\wow_main_theme.mp3");
PlayMusic("Interface\\AddOns\\Foo\\bar.mp3");

ResultEdit

Current music fades out, login or custom music plays.

NotesEdit

  • You cannot pause the playback, but you can stop it with StopMusic().
  • You cannot use this function to play custom MP3 files located outside an addon's directory.
  • To play MP3 files that were added to an addon's directory after WoW has been launched you will first have to restart the game client.
  • If any of the built-in music is playing when you call this function (e.g. Stormwind background music), it will fade out.
  • (Verified): since World of Warcraft uses the FMOD sound engine, it is very likely that other file formats than mp3 are supported. For example OggVorbis (.ogg).
  • The playback loops until it is stopped with StopMusic().
  • For some reason, during most (but not all) raid encounters the music played will suddenly stop.