How do i add SingleSound to GameParameter using fmod java script

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.


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

Add Single Sound to Parameter Sheet{
    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!

1 Like

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