# FMod Web API Failed to get parameter

**URL:** <https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121>\
**Category:** FMOD Engine\
**Created:** [April 16, 2023, 8:53am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121 "2023-04-16T08:53:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeltaElement](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DeltaElement](https://qa.fmod.com/u/DeltaElement)\
**Post date:** [April 16, 2023, 8:53am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/1 "2023-04-16T08:53:22Z")

</div>

Hi ! In my website i want to integrate a parameter to change values on audio with the FMod Studio API.  
I started from the example “event\_parameter” and I changed the soundbank, the name of the parameter and the event called but the script sends me: “Error!!! ‘The requested event, parameter, bus or vca couldn’t be found.’”

The error is in the line `CHECK_RESULT(gEventInstance.setParameterByID(gSurfaceID, surfaceParameterValue, false));` and i dont know why it didn’t work.

(sorry for the spelling I am French)

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 17, 2023, 12:12am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/2 "2023-04-17T00:12:52Z")

</div>

Hi,

To clarify:

- Have you spelled the parameter name correctly? Capitalization shouldn’t matter
- Does the parameter whose name has been changed exist in your event?

If you’re using a new event and parameter, have you done the following:

1. Created a new event in FMOD Studio
2. Added your new parameter to the event
3. Assigned the event to the bank you’re going load
4. Built your banks

If you want to verify that your event has a specific parameter, you can use [`Studio::EventDescription::getParameterDescriptionCount`](https://www.fmod.com/docs/2.02/api/studio-api-eventdescription.html#studio_eventdescription_getparameterdescriptioncount) to get the total number of parameters in the event, and then iterate using the parameter count with [`Studio::EventDescription::getParameterDescriptionByIndex`](https://www.fmod.com/docs/2.02/api/studio-api-eventdescription.html#studio_eventdescription_getparameterdescriptionbyindex) to get all the parameter descriptions.

---

<div class="post-metadata">

**Author:** ![DeltaElement](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DeltaElement](https://qa.fmod.com/u/DeltaElement)\
**Post date:** [April 20, 2023, 10:21am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/3 "2023-04-20T10:21:39Z")

</div>

I checked the error with “getParameterDescriptionCount(1)” and he send me 0 every time.  
The message changed to "Error!!! ‘An invalid parameter was passed to this function.’ "  
Its the right name, with the right build and the right assingation.

I placed my parameter called “PlainOrForest\_param” in a folder in FMod  
Should the parameter name change from “PlainOrForest\_param” to “Ambiance Modifiers/PlainOrForest\_param” ?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 20, 2023, 11:46pm UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/4 "2023-04-20T23:46:22Z")

</div>

> [@DeltaElement](#):
>
> I checked the error with “getParameterDescriptionCount(1)” and he send me 0 every time.  
> The message changed to "Error!!! ‘An invalid parameter was passed to this function.’ "  
> Its the right name, with the right build and the right assingation.

The `count` argument of `getParameterDescriptionCount` is a reference to a var that FMOD will assign a value to. You need to pass it to the function like so:

```auto
var paramCount = 0;
youEventInstance.getParameterDescriptionCount(paramCount);
console.log(paramCount);

```

> [@DeltaElement](#):
>
> I placed my parameter called “PlainOrForest\_param” in a folder in FMod  
> Should the parameter name change from “PlainOrForest\_param” to “Ambiance Modifiers/PlainOrForest\_param” ?

If you’ve done the following:

- Added the parameter “PlainOrForest\_param” to your event
- Assigned the event to a bank
- Built your banks
- Loaded your built banks in your code - see lines 151-153 of `event_parameter.js` in the Studio API HTML5 example

Then you should be able to access the parameter using just the name “PlainOrForest\_param” - you shouldn’t need “Ambiance Modifiers/PlainOrForest\_param”.

The most common way to use the parameter name is to create your [`EventInstance`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html) using the [`EventDescription`](https://www.fmod.com/docs/2.02/api/studio-api-eventdescription.html), and then use [`EventInstance::setParameterByName`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_setparameterbyname) with the name to set the parameter value for that event.

The `event_parameter.js` example uses a slightly different approach, where it gets the [`ParameterDescription`](https://www.fmod.com/docs/2.02/api/studio-api-common.html#fmod_studio_parameter_description) from the[`EventDescription`](https://www.fmod.com/docs/2.02/api/studio-api-eventdescription.html) (line 161), then gets the parameter ID from the [`ParameterDescription`](https://www.fmod.com/docs/2.02/api/studio-api-common.html#fmod_studio_parameter_description) (line 162), and uses the ID instead of the name to set the parameter value with [`EventInstance::setParameterByID`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_setparameterbyid) (line 170).

---

<div class="post-metadata">

**Author:** ![DeltaElement](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DeltaElement](https://qa.fmod.com/u/DeltaElement)\
**Post date:** [April 21, 2023, 9:20am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/5 "2023-04-21T09:20:09Z")

</div>

Okay so i think use `EventInstance::setParameterByName` is what i want.

So I tried several things:  
`colorfullAmbienceInstance.setParameterByName` but the error **“colorfullAmbienceInstance.setParameterByName is not a function”** appeared  
`gEventInstance.setParameterByName` but the error **“a invalid parameter passed to this function”** appeared.  
When i change the name of the parameter and choose another who exist in the sounbank but the console tell me : **Error!!! ‘The requested event, parameter, bus or vca could not be found.’**

I think the second test was correct but I don’t understand why FMod indicates that the event doesn’t exist. My sound bank has been updated several times and I’m sure I have the parameter in it. The import of banks also works because I have an event from my sound bank that can be read.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 26, 2023, 1:24am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/6 "2023-04-26T01:24:23Z")

</div>

In that case, to help me diagnose the issue, could I get you to upload your code and your packaged FMOD Studio project (packaged with assets, if possible) to your [FMOD Profile](https://www.fmod.com/profile) under the “Uploads” tab?

---

<div class="post-metadata">

**Author:** ![DeltaElement](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DeltaElement](https://qa.fmod.com/u/DeltaElement)\
**Post date:** [May 1, 2023, 7:05pm UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/7 "2023-05-01T19:05:06Z")

</div>

I failed to upload my project to the “FMOD Profile” page my project disappeared  
It is not possible to send a . zip archive by mail or just a wetransfer link ?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [May 2, 2023, 2:14am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/8 "2023-05-02T02:14:47Z")

</div>

There may have been an issue on our end - try again now and see if it uploads successfully. Failing that, please email [support@fmod.com](mailto:support@fmod.com) either your project, or a link to it, as well as a link this forum thread.

---

<div class="post-metadata">

**Author:** ![DeltaElement](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DeltaElement](https://qa.fmod.com/u/DeltaElement)\
**Post date:** [May 8, 2023, 8:02am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/9 "2023-05-08T08:02:04Z")

</div>

I send my files. The fail page is on `WebsiteSRC\projects\hideandflee\hideandflee.js` with the slider “setVolumeSlider”

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [May 10, 2023, 12:31am UTC](https://qa.fmod.com/t/fmod-web-api-failed-to-get-parameter/20121/10 "2023-05-10T00:31:08Z")

</div>

After a look at your project, it appears that the issue is that the `masterVolume_param` parameter is a global parameter, and isn’t tied to the “Colorfull” event like `PlainOrForest_param` or `LevelStage_param` are. This means it cannot be set with calls to the event; instead, to set a global parameter, you can use the FMOD Studio System’s `setParameter` functions - in this case, [`Studio::System::setParameterByName`](https://www.fmod.com/docs/2.02/api/studio-api-system.html#studio_system_setparameterbyname) is probably what you want.
