# Procedural LipSync using FMOD - need help to get value of volume

**URL:** <https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [November 5, 2020, 12:59am UTC](https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396 "2020-11-05T00:59:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pegazkoksu](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Pegazkoksu](https://qa.fmod.com/u/Pegazkoksu)\
**Post date:** [November 5, 2020, 12:59am UTC](https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396/1 "2020-11-05T00:59:56Z")

</div>

Hello fellas,  
I want to make simple lipsync, based on audio volume. I’ve made something like this based on unity’s audio source earlier, but I have no idea how to achieve this effect using fmod.  
For starters, is there any way to get value of current volume, each frame from specific emitter, that is playing event?

This is what I made before with audio source:  
_[https://www.youtube.com/watch?v=LwX0M1Z0jYY](https://www.youtube.com/watch?v=LwX0M1Z0jYY)_

---

<div class="post-metadata">

**Author:** ![FoxyMusic](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@FoxyMusic](https://qa.fmod.com/u/FoxyMusic)\
**Post date:** [November 5, 2020, 7:12am UTC](https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396/2 "2020-11-05T07:12:27Z")

</div>

Hi, try to side chain parameter with speech event volume (before master so you’ll be able to change voice volume and not affecting lip sync). Then get this parameter in you game and attach it to lipsync.  
Hope you’ll find it usefull

---

<div class="post-metadata">

**Author:** ![Pegazkoksu](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Pegazkoksu](https://qa.fmod.com/u/Pegazkoksu)\
**Post date:** [November 5, 2020, 2:36pm UTC](https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396/3 "2020-11-05T14:36:36Z")

</div>

Thanks bro, this is exactly what I were looking for:)

---

<div class="post-metadata">

**Author:** ![Pegazkoksu](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Pegazkoksu](https://qa.fmod.com/u/Pegazkoksu)\
**Post date:** [November 5, 2020, 4:55pm UTC](https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396/4 "2020-11-05T16:55:51Z")

</div>

I’ve got another question, might be a bit noobish - how to get parameter value from event? I’ve set parameter “Volume” on event, that is modulated by sidechain. In preview in FMOD editor works like a dream, but inside Unity, when I try to get this parameter I get value of 0.  
This is piece of my code:

```
private IEnumerator Lipsync(StudioEventEmitter emitter)
{
    float duration = 0;
    float volume = 0;
    emitter.Event = _speechEvent;
    emitter.Play();

    while (duration < 3)
    {
        emitter.EventInstance.getParameterByName("Volume", out volume);
        SetJawOffset(volume);

        duration += Time.deltaTime;
        yield return new WaitForEndOfFrame();
    }
}
```

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [November 9, 2020, 10:46pm UTC](https://qa.fmod.com/t/procedural-lipsync-using-fmod-need-help-to-get-value-of-volume/16396/5 "2020-11-09T22:46:49Z")

</div>

[`getParameterByName`](https://fmod.com/resources/documentation-api?version=2.1&page=studio-api-eventinstance.html#studio_eventinstance_getparameterbyname) has two out parameters: `value` which is the value as set from the public API (eg. from calling `setParameter...`) and `finalValue` which is the end result of the parameter after applying adjustments due to automation, modulation, seek speed, and parameter velocity.
