|
Post by tenpn on Aug 9, 2016 15:35:33 GMT
I've got some bullet SFX that's shared between the player and teammates. For the teammates they should play in 3D, and for the player they should play in 2D. At the moment they're all going into the same bus, that _isn't_ forced to 2D.
I play the player-local sounds with PlaySoundAndForget(), but it audibly comes out in 3D. If this function is subservient to the force-2D setting on the bus, what should it be used for?
What kind of setup do I need to make this work, without just copy-and-pasting every group for players and teammates? And can you confirm that it would allow the same variation to be playing from a 3D teammate as well as for the 2D player?
I'm on MasterAudio 4.0. Thanks in advance.
|
|
|
Post by DarkTonic Dev on Aug 9, 2016 16:00:37 GMT
Whether the sound comes out in 3D or not is controlled by your Spatial Blend rule (assuming you're on Unity 5), not what API you call. You also can override the spatial blend rule with the force 2D setting on the bus if you like, but the primary setting is the other one I mentioned.
In any case, the same Sound Group cannot be played in both 2D and 3D. You would need to set up 2 different Sound Groups, one for 2D and one for 3D. -Brian
|
|
|
Post by tenpn on Aug 9, 2016 16:14:14 GMT
so just to be clear, I need eg a shotgun_2D and a shotgun group, each containing identical variations except for the spatial blend param on the audio source, pointing at different busses?
|
|
|
Post by tenpn on Aug 9, 2016 16:16:47 GMT
...and only then playing them with PlaySoundAndForget? Or does that not matter? And if it doesn't, when does it?
|
|
|
Post by DarkTonic Dev on Aug 9, 2016 20:00:49 GMT
You don't have to point to different buses unless you want to use the Force to 2D option on the bus, or other bus-only features. The Group's (or mixer's) Spatial Blend Rule will take care of the 2D-ness.
You would use PlaySoundAndForget if you don't care where the SFX plays (i.e. it will play at the location of the Master Audio game object). That would normally only be the case for sounds that you have set as 2D. But if you had set them as 2D, they still would sound the same if you call PlaySound3DAndForget as well...
It only matters if you care where the actual Variation game object is while it's playing. It will sound the same.
|
|
praaug
New Member
Posts: 9
Posts: 9
|
Post by praaug on Aug 15, 2016 9:50:32 GMT
We had the same problem some time ago. We now use only one SoundGroup and setting the spacialBlend of the AudioSource after the sound is played.
PlaySoundResult _result = MasterAudio.PlaySound3DAtTransform("groupName", player.transform);
if(_result==null || _result.ActingVariation == null) // prevent nullRefs when the soundGroup is already playing all variations return;
if(player.hasControl) _result.ActingVariation.VarAudio.spatialBlend = 0.0f; else _result.ActingVariation.VarAudio.spatialBlend = 1.0f;
I Hope that can help you
Fabian[/quote]
|
|
|
Post by DarkTonic Dev on Aug 15, 2016 14:31:12 GMT
Code looks good
|
|