magique
Full Member
Posts: 194
Posts: 194
|
Post by magique on Mar 12, 2016 17:55:07 GMT
I am a Wii U developer and one of the things we have to deal with is mirroring sounds on the Wii U gamepad. This is done by calling a WiiU function and passing it one or more AudioSource objects. Currently, I have a small script that I attach to any object having AudioSource components and the script automatically assigns them all to play on the Gamepad. So, I'm interested in knowing where in the Master Audio code would I need to look to get the AudioSource components used by Master Audio so that I can assign them to the Wii U Gamepad?
|
|
|
Post by DarkTonic Dev on Mar 12, 2016 19:27:40 GMT
So you need a method to return a list of all Audio Sources used? I can add that for the next version once we're clear. There can be hundreds depending on how many sound effects you have.
|
|
magique
Full Member
Posts: 194
Posts: 194
|
Post by magique on Mar 12, 2016 20:00:41 GMT
So you need a method to return a list of all Audio Sources used? I can add that for the next version once we're clear. There can be hundreds depending on how many sound effects you have. Yes, that would work. And it doesn't matter how many there are as long as we are not talking about a list that is going to be changing dynamically at runtime. The assignment to the Wii U gamepad only needs to be done once. If there is the possibility that AudioSources might get added during runtime then I would also need a way to be notified when that occurs so that I could make the assignment at that time.
|
|
|
Post by DarkTonic Dev on Mar 12, 2016 21:34:09 GMT
The list only changes at runtime if you use DynamicSoundGroupCreator prefabs to add "sound skins" or call one of the AddVaration API methods (the latter is not used by most people). Otherwise everything is created in the Awake method of the Master Audio game object. I'll take an initial stab at this for the next version.
|
|
magique
Full Member
Posts: 194
Posts: 194
|
Post by magique on Mar 12, 2016 22:33:18 GMT
The list only changes at runtime if you use DynamicSoundGroupCreator prefabs to add "sound skins" or call one of the AddVaration API methods (the latter is not used by most people). Otherwise everything is created in the Awake method of the Master Audio game object. I'll take an initial stab at this for the next version. Thanks. It will definitely be needed or I can't play audio on the Gamepad.
|
|
|
Post by DarkTonic Dev on Mar 15, 2016 5:35:12 GMT
This is added for the next version:
- Added a property that keeps an up to date list of all Audio Source used by Master Audio (MasterAudio.MasterAudioSources). - Add an event you can listen to that notifies if the list of all Audio Sources changes (MasterAudio.NumberOfAudioSourcesChanged += delegate {})
|
|
magique
Full Member
Posts: 194
Posts: 194
|
Post by magique on Mar 15, 2016 13:40:42 GMT
This is added for the next version: - Added a property that keeps an up to date list of all Audio Source used by Master Audio (MasterAudio.MasterAudioSources). - Add an event you can listen to that notifies if the list of all Audio Sources changes (MasterAudio.NumberOfAudioSourcesChanged += delegate {}) Excellent. Thanks.
|
|
|
Post by DarkTonic Dev on Mar 15, 2016 15:41:26 GMT
No problem
|
|