Playing Music
I'm making an addon that functions like a radio station for the guild, playing music files (assuming the guild members have them) whenever an officer clicks 'Play' on the addon.
PlayMusic works, but only if they have it enabled in sound options, and if loop is checked it keeps looping the song. Is there any way to make it play the tracks regardless of the Music option in sound settings, without losing the ability to stop the track at any time? If not, is there a way to enable music for the track, then disable it before it loops? |
Best way to do this is to store the current cvar sound settings, set the ones you want, then change them after you're finished.
So...like this: Code:
local oldEnableMusic,oldLooping = GetCVar("Sound_EnableMusic"), GetCVar("Sound_ZoneMusicNoDelay") |
That looks great, my only question is how can I find out if the song has finished playing? The only way I can think of right now is the addon would have to have the length of the song in seconds added to it's table for song information. That is possible, but is there any other built-in method to determine if music is still playing?
|
Quote:
|
All times are GMT -6. The time now is 06:37 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI