在 Audiokinetic 社区问答论坛上,用户可对 Wwise 和 Strata 相关问题进行提问和解答。如需从 Audiokinetic 技术支持团队获取答复,请务必使用技术支持申请单页面。

0 投票

I tried various ways to set the Switch Group property of a Switch Container but I can't get it to work.

I first create a random container with two Switch Containers. I then iterate through the Switch Containers and my intention is to apply a Switch Group to each one.

function createObject(session){
    var container = {
      "parent": "{8250D45E-B369-40D4-A2D2-62DE313EBA7F}",
      "type": "RandomSequenceContainer",
      "name": "RandContainer",
      "@RandomOrSequence": 1,
      "children": [
        {
          "type": "SwitchContainer",
          "name": "A",
          "children" : [
            {"type" : "Sound", "name" : "aa"},
            {"type" : "Sound", "name" : "bb"},
            {"type" : "Sound", "name" : "cc"},
            {"type" : "Sound", "name" : "dd"}
          ]
        },

       {
          "type": "SwitchContainer",
          "name": "B",
          "children" : [
            {"type" : "Sound", "name" : "ee"},
            {"type" : "Sound", "name" : "ff"},
            {"type" : "Sound", "name" : "gg"},
            {"type" : "Sound", "name" : "hh"}
          ]
        }
      ]
    }

    session.call('ak.wwise.core.object.create', [], container ).then(
      function(res) {
        var children = res.kwargs.children
        children.map((child) => {
          console.log(child.id)
          const st = {
            "object" : child.id,
            "reference" : 'StateGroup',         <-----------  //I tried 'State', 'Switch', "StateGroup", "SwitchGroup", "SwitchContainer" also tried "property" instead of "reference"
            "value" : '{F1B87108-BC75-4400-8556-AD5235907703}'
          }
          session.call('ak.wwise.core.object.setReference', [], st).then(      <-----------  //Here I tried .setProperty, when using "reference" in the above object. Also I tried having the object as the second argument in the method...
            function(r) {
              console.log(r)
            },
            function(e){
              console.log(e)
            }
          )
        })
      },
      function (error) {
        console.log('error: ', error);
      }
    ).then(
      function() {
        connection.close();
      }
    );
}

 

One more thing - How would I go about associating a sound file to a particular State?

分类:General Discussion | 用户: Ando (190 分)

1个回答

0 投票
The property you want, I believe is: "@SwitchGroupOrStateGroup"
And to assign a child of the Switch Container to a particular State or Switch, use "ak.wwise.core.switchContainer.addAssignment"
Hope that helps!
用户: Cody F. (140 分)
...