Sorry for a lame question.
Is it possible to get Position, Index and Callback onEnter of a listener in attenuation without Unity collisions?
I’m guessing FMOD is constantly receiving this info, maybe there is a way to get it.
By using Unity collisions we would duplicate process or I’m mistaken?
Sorry for a lame question.
Could you elaborate on the functionality you are looking for? If you look at
StudioListener.cs you are able to use
ListnerCount() to retrieve the current index of the listener. There is also the
listeners list that you can use to check all the other listeners. You could track the position of the listeners yourself using the list and avoid having to use collisions. Let me know if the helps.
Sorry, didn’t give you any context. I’m thinking about stereo audio system for split screen car game.
I want every event has panning parameter (every event that I need to be panned). This parameter depend on proximity of event to listeners. Which one is closer those channel gets more signal from event.
So thank you for
RuntimeManager.StudioSystem.getListenerAttributes(0, out FMOD.ATTRIBUTES_3D attributes); this is what I need to get distance to sound source (event).
But I need also to know if a listener is inside attenuation radius. I can calculate it by finding distance to event, but I don’t like an idea every event has a script to calculate distance to two listeners all the time.
So maybe there is a sort of event (delegate) which indicates that a listener is inside attenuation?
Thank you for the explanation. A solution may be to use the
FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL callback (FMOD Engine | Studio API Reference - FMOD_STUDIO_EVENT_CALLBACK_TYPE). With the events stealing behavior set to virtualization (FMOD Studio | Advanced Topics - Stealing)
The callback is triggered when an event becomes
real and is heard by a listener. An example for setting up a callback can be found here: Unity Integration | Scripting Examples - Timeline Callbacks
Let me know if this is the behavior you are looking for.
Thank you. I didn’t have much time to experement this week.
I set a
FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL but it works only if the same event is present on scene and it becomes real or virtual. With only one event present this callback isn’t triggered, at least I can’t make it happen, I might certainly miss something.
The only solution I can think of is to make one event for athmospheres so it would be only one real possible. Also first spawned event (possiblly) takes back voice once player leave another instances, means that it doesn’t leave current event virtual but passes virtual voice to first one.