# How to use getParameterByName

**URL:** <https://qa.fmod.com/t/how-to-use-getparameterbyname/19521>\
**Category:** FMOD Studio\
**Created:** [November 14, 2022, 9:59am UTC](https://qa.fmod.com/t/how-to-use-getparameterbyname/19521 "2022-11-14T09:59:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniellumertz](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@daniellumertz](https://qa.fmod.com/u/daniellumertz)\
**Post date:** [November 14, 2022, 9:59am UTC](https://qa.fmod.com/t/how-to-use-getparameterbyname/19521/1 "2022-11-14T09:59:45Z")

</div>

Sorry that I am a bit new but I really dont understand how these arguments with ‘out’ works. It seems to return more values to a variable I set, but still I cant make it work, or dont use the second argument I had the impression the second argument would be optional but it throws an error without it…

This is what is the error :

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/b09cb7de886622f5d48a6cd97e2111072468a77a.png)

```auto
        float value_b;
        float value_a;
        value_a = Music.getParameterByName("Music Parameter 1", out value_b);

```

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [November 14, 2022, 10:38am UTC](https://qa.fmod.com/t/how-to-use-getparameterbyname/19521/2 "2022-11-14T10:38:52Z")

</div>

The value of the parameter will be stored in the “out” variable. You probably have to remove “value a =”, in your exemple.  
(I may be wrong, though.)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [November 15, 2022, 12:20am UTC](https://qa.fmod.com/t/how-to-use-getparameterbyname/19521/3 "2022-11-15T00:20:10Z")

</div>

Hi,

Alcibiade is correct. Just a few things to add on.  
The return result of most FMOD functions is `FMOD_RESULT` which is a super useful debugging tool. A full list of Results is under [FMOD API | Core API Reference](https://fmod.com/docs/2.02/api/core-api-common.html#fmod_result). How you would want to change your function is:

```auto
FMOD.RESULT result = Music.getParameterByName("Music Parameter 1", out value_b);
/* Then you can check if the function ran successfully. */
if (result != FMOD.RESULT.OK)
    Debug.Log("Get Parameter by named failed with result: " + result); 

```

This is a useful way to use the result return to debug FMOD.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![daniellumertz](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@daniellumertz](https://qa.fmod.com/u/daniellumertz)\
**Post date:** [November 15, 2022, 12:31pm UTC](https://qa.fmod.com/t/how-to-use-getparameterbyname/19521/4 "2022-11-15T12:31:27Z")

</div>

Thanks for the solution Alicibiade it worked nice here. Thanks for the information Connor that is very good to know!
