# How do i add SingleSound to GameParameter using fmod java script

**URL:** <https://qa.fmod.com/t/how-do-i-add-singlesound-to-gameparameter-using-fmod-java-script/19263>\
**Category:** FMOD Studio\
**Created:** [September 12, 2022, 4:53am UTC](https://qa.fmod.com/t/how-do-i-add-singlesound-to-gameparameter-using-fmod-java-script/19263 "2022-09-12T04:53:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maulikkaloliya](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@maulikkaloliya](https://qa.fmod.com/u/maulikkaloliya)\
**Post date:** [September 12, 2022, 4:53am UTC](https://qa.fmod.com/t/how-do-i-add-singlesound-to-gameparameter-using-fmod-java-script/19263/1 "2022-09-12T04:53:56Z")

</div>

How do i add SingleSound to specific GameParameter using fmod java script, I don’t find any solution.

I have added SingleSound to event timeline with this function

var event = studio.window.browserCurrent();  
track.addSound(event.timeline, “SingleSound”, 1000, 1000);

But I unable to add sound to GameParameter.

---

<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:** [September 15, 2022, 1:40am UTC](https://qa.fmod.com/t/how-do-i-add-singlesound-to-gameparameter-using-fmod-java-script/19263/2 "2022-09-15T01:40:28Z")

</div>

Hi,

Here is a script to add a single sound to a parameter sheet.

> **Add Single Sound to Parameter Sheet**
>
> ```auto
> 
> studio.menu.addMenuItem({
> name: "Assing Single Sound to Parameter",
> execute: function() {
> var index = studio.system.getText("Parameter Index:", "Index");
> var start = studio.system.getText("Start:", "0");
> var finish = studio.system.getText("Finish:", "0");
> var event = studio.window.browserCurrent();
> var track = event.addGroupTrack();
> var singleInstrument = track.addSound(event.parameters[index], 'SingleSound', start, finish);
> }
> })
> 
> ```

Index: which parameter sheet you want to add the sound to. 0 = the first parameter.  
Start: position of the beginning of the sound in the parameter sheet.  
End: position of the end of the sound in the parameter sheet.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![maulikkaloliya](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@maulikkaloliya](https://qa.fmod.com/u/maulikkaloliya)\
**Post date:** [December 21, 2022, 1:06pm UTC](https://qa.fmod.com/t/how-do-i-add-singlesound-to-gameparameter-using-fmod-java-script/19263/3 "2022-12-21T13:06:54Z")

</div>

Thanks it’s working very well and really helped me.
