0
0

Version 1.0 – DOWNLOAD THE UNITYPACKAGE at the bottom

[img:1l4ljcs9]http://s30.postimg.org/3srloh51t/Screen_Shot_2014_03_14_at_11_07_04_PM.png[/img:1l4ljcs9]

[b:1l4ljcs9]Features:[/b:1l4ljcs9]

  1. Drag & Drop FMODAsset into Inspector
  2. Automatically creates a List of all parameters & shows their names and min/max values in Inspector
  3. Start On Awake checkbox
  4. [fake] Geometry Occlusion

[b:1l4ljcs9]Setup:[/b:1l4ljcs9]

  1. Drag FmodEventPlayer.cs onto GameObject that should emit the sound.
  2. Drag Event from Folder FMODAssets into the [i:1l4ljcs9]Asset[/i:1l4ljcs9] field in the Inspector

[b:1l4ljcs9]Events:[/b:1l4ljcs9]

Use the following commands to access the event instance:

[code:1l4ljcs9]
soundEvent.start()
soundEvent.stop()
soundEvent.release()
etc...
[/code:1l4ljcs9]

[b:1l4ljcs9]Parameters:[/b:1l4ljcs9]

Upon pressing Play in Unity, you’ll find all the event’s parameters within an array in the inspector,
from where they can be accesed using the following syntax:

[code:1l4ljcs9]
soundEventParams[0].setValue(newValue);
soundEventParams[1].setValue(newValue);
soundEventParams[3].getValue();
etc...
[/code:1l4ljcs9]

Note: [i:1l4ljcs9]The Inspector shows the parameters names & even their min/max values.[/i:1l4ljcs9]

[b:1l4ljcs9]Occlusion:[/b:1l4ljcs9]

[b:1l4ljcs9]!!! For Occlusion to work – your event needs to have a parameter that is called "[i:1l4ljcs9]Occlusion[/i:1l4ljcs9]" with min/max values between [0-1]. [/b:1l4ljcs9]

  1. Tick the [i:1l4ljcs9]Use Occlusion[/i:1l4ljcs9] Box
  2. Drag the GameObject that holds your FMOD_Listener Component into the [i:1l4ljcs9]Fmod Listener[/i:1l4ljcs9] field in the inspector

[quote:1l4ljcs9]How the fake Occlusion works:
– It casts a lineCast from the soundSource to the Listener
– if the lineCast hits something, the Occlusion parameter gets tweened & vice versa[/quote:1l4ljcs9]

[b:1l4ljcs9]TO DO:[/b:1l4ljcs9]
-> Add LayerMask Support for Occlusion Linecast

Note: [i:1l4ljcs9]FmodEventPlayer currently uses iTween, which I included in the unitypackage.[/i:1l4ljcs9]

  • You must to post comments
0
0

You could make this a tad more user friendly by storing the parameters in a dictionary instead of a standard array. I had a go an this is what I came up with, it works too:

[code:31o2okxq]
private FMOD.Studio.ParameterInstance p = null;
private FMOD.Studio.PARAMETER_DESCRIPTION description = new PARAMETER_DESCRIPTION();
public Dictionary<string, FMOD.Studio.ParameterInstance> parameters = new Dictionary<string, FMOD.Studio.ParameterInstance>();

void CacheEventParameters()
{
int parameterCount;
ERRCHECK(evt.getParameterCount(out parameterCount));

    for (int i = 0; i &lt; parameterCount; i++)
    {
        ERRCHECK(evt.getParameterByIndex(i, out p));
        ERRCHECK(p.getDescription(out description));
        parameters.Add(description.name, p);
    }
}

[/code:31o2okxq]
So now you can reference parameters by their actual name instead of remembering their position in an array.

[code:31o2okxq]
parameters["ParameterName"].SetValue(value);
[/code:31o2okxq]
I personally turned it into a function so all I need to do is call SetParameterValue(string, float).

  • You must to post comments
0
0

cool stuff man – that’s really helpful – i never used dictionaries before – so i didn’t know how to do this.

very much appreciated !!! :-)

  • You must to post comments
0
0

Cool stuff, excited to try it out. Would love to see FMOD develop true occlusion and reflections like GSOUND http://gamma.cs.unc.edu/GSOUND/ as well as true HRTF!

  • You must to post comments
0
0

Very much appreciated, thank you.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.