View Single Post
04-12-18, 07:59 PM   #8
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
https://wow.gamepedia.com/API_PlayMusic

(Maybe PlaySoundFile too, idk)

You would have a table containing all the file names for your music files, and in your function which would pick out music to play, you would insert the file name into PlayMusic, and also process it separately to remove the extension and the leading folder names, so that you could display just the actual file's name w/o its extension.

All music would need to be copied into the addon's directory. You can't tell the game to blanket read all music files within the directory; all files need to have their file path added in the list in your addon's code.

(If you're going to output that in chat, I recommend you at least stick to custom emotes, unless you know that the people who will be around you while you use it won't mind it. Because a custom emote is less annoying than a /say message by default.)
  Reply With Quote