4.0.6 change to PlaySoundFile() & PlaySound()

UI and Macro
Rejoice! You can now unlink your addon sounds and game sounds again.

PlaySoundFile() and PlaySound() have been updated to accept an optional second argument, allowing addon authors to designate which sound bus/channel to play the sound on. If the optional second argument is omitted, the functions behave as normal (current behavior).

PlaySound("sound" [, "channel"])
PlaySoundFile("sound" [, "channel"])

"channel" is a string with the following possible values. Using "Master" will ignore other sound levels.
    "SFX"
    "Music"
    "Ambience"
    "Master"
Oh my god!

Tramapoline!
Trambopoline!

Good news :)
What's the difference between PlaySound, and PlaySoundFile? Is PlaySound for default Blizzard sounds, and PlaySoundFile for custom ones?
02/12/2011 12:28 PMPosted by Fse
What's the difference between PlaySound, and PlaySoundFile? Is PlaySound for default Blizzard sounds, and PlaySoundFile for custom ones?


http://www.wowpedia.org/API_PlaySound
http://www.wowpedia.org/API_PlaySoundFile

But yeah, pretty much. PlaySoundFile can also be used for non-custom sounds.
I've already updated DBM with this change. thanks for heads up! Alpha version right now, i'll try to get a curse version tagged very soon once some other stuff is wrapped up :)
(Bump)

Let's keep this on the front page, so authors can make their changes. :)
02/13/2011 3:20 PMPosted by Tseerah
(Bump)
authors are pretty communitive, i'm sure most will make the updates soon enough. just watching svn logs on irc they will see other authors do it and be reminded quite a bit :P
It looks like PlaySoundFile("Sound\\interface\\ReadyCheck.wav") played at a "loud" volume last night for me. Gonna have to test this out with the parameters.
Forgive me if I'm misunderstanding something. For the general user, if we want just addon sounds running now, with little or nothing else, for example, which sound level are we keeping on?

Is that up to the addon author's discretion? Or does the general user not have to touch anything? (ie, with master, and the 3 sounds turned to 0, can we still hear addon sounds?)
@trex

by default it'll use sfx volume with no optional parameter. If sound effects are turned off so are addons sounds.

The big key to "Master" isn't to use a diff volume (although it's nice, so addon sounds can be louder than spell effect noises). The advantage is to stlll have addon sounds when effects are turned off completely :) Sound itself still has to be enabled though using master channel. but you can have ambiant, music and effects all turned off with addon sounds still being available. Very useful for tabbing out to watch a video, but wanting to still get that addon sound for a whisper or readycheck. Or having DBM, bigwigs, raidwatch, etc able to give you audible warnings if you turned everything else off.

This is something addons have to be updated for. Care must also be used by authors if they wish to maintain CN compatbility because they may have to use an if/else rule in their playsound function to use it with optional arg on 4.0.6+ but not on older, so it doesn't throw up "wtf" errors on CN wow when it doesn't understand the optional arg. Some users may have also gotten used to way 4.0 has been since it's been several months, so they may not like it going back to mastery. For this reason i also added an option to choose whether addon goes back to pre 4.0 method or stays with current SFX method. I get feeling most will have Master as preference though as that's how addons worked up until 3.3.5.
I was running w/o sound last night and without the optional parameter, PlaySoundFile still played and I was able to hear it. So if it's defaulting to SFX than that overrides game sound. It might be that the parameter allows you to pick which sound volume you want it regardless it'll play when you have sound off (e.g. ctrl-s).
02/14/2011 12:14 PMPosted by Ackis
I was running w/o sound last night and without the optional parameter, PlaySoundFile still played and I was able to hear it. So if it's defaulting to SFX than that overrides game sound. It might be that the parameter allows you to pick which sound volume you want it regardless it'll play when you have sound off (e.g. ctrl-s).


really?

see my tests showed opposite. If i do not use "Master" parameter, and turn off sound effects checkbox, my addon no longer makes any sound at all using PlaySoundFile.

do this test

turn off sound effects

then

/script PlaySoundFile("Sound\\Creature\\Illidan\\BLACK_Illidan_04.wav")

now do

/script PlaySoundFile("Sound\\Creature\\Illidan\\BLACK_Illidan_04.wav", "Master")
Might be with how sound gets turned off/on. I only use the shortcut "CTRL-S". I don't even know what that turns on/off.

I'm not at a WoW machine now so can't test anything (until tonight).
now if only boss mods: text-to-speech gets updated ... =)
so is there any working addon that allows me to play boss emotes?
http://www.wowinterface.com/downloads/info18781-MutedSounds-combatonly.html#info

Found this
Might be with how sound gets turned off/on. I only use the shortcut "CTRL-S". I don't even know what that turns on/off.

I'm not at a WoW machine now so can't test anything (until tonight).


That turns off Sound Effects, not the master sound.
this is fail the auther of the addon has to make the switch i want a more advanced sound option list so i can turn all this crap off and only hear my addon
05/18/2011 03:29 AMPosted by Hôlykill
this is fail the auther of the addon has to make the switch i want a more advanced sound option list so i can turn all this crap off and only hear my addon
A few things:
  • Calling things fail will only make people less likely to help you.
  • AddOn authors are volunteer workers. They have no obligation to update their AddOns, they simply do so as a favour to the users.
  • You managed to go on a rant about the author not updating the AddOn, but not once did you mention which Author/AddOn you're talking about.
  • Join the Conversation

    Return to Forum