Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Can't manage to instantiate a GetRTPCValue to a specific gameObject (Wwise/Unity)

+1 vote

I wanted to get the volume of sounds played in my unity scene from a wwise meter via output game parameter i called "volume". So i created a wwise Meter effect on my sounds and i created a script on each gameobject that plays those sounds in unity with those lines :

 

int type = (int)RTPCValue_type.RTPCValue_GameObject ;
AkSoundEngine.GetRTPCValue("Volume", gameObject, out volume, ref type) ;
 
 
Unfortunatly the RTPC "Volume" still seems to be global, as even if no sounds are played by the gameobject containing those script lines, the output value "volume" get the RTPC "Volume" number when other sounds containing the wwise meter effect are playing on other gameObjects ...
 
It s like the "RTPCValue_GameObject" would be the same as "RTPCValue_Global" 
 
Any helps ? :)
 
EDIT : Debug.Log(type) returns 1 (which should correspond to "RTPCValue_Global"
 
 
 
asked Nov 6, 2014 in General Discussion by Florent D. (470 points)
edited Nov 6, 2014 by Florent D.

5 Answers

+1 vote
I'd love to get an answer as well.

Thanks!
answered Jul 31, 2015 by Jean-Edouard M. (370 points)
+1 vote
Well I can answer you jean-Edouard.

It's not a bug, it is just not implemented, the RTPC attached to Meters are global. The only solution we found here is to create one unique RTPC per gameObject. It's a bit annoying but works well...

 

Cheers
answered Aug 27, 2015 by Florent D. (470 points)
+1 vote
0 votes

you have to define the in_playingID, try this:

        int type = (int)RTPCValue_type.RTPCValue_GameObject;

        uint pid = (uint)RTPCValue_type.RTPCValue_PlayingID;

 

 

        AkSoundEngine.GetRTPCValue("Volume", this.gameObject, pid, out volume, ref type);

 

then just debug volume ;)

 

answered Mar 10, 2017 by Ratko F. (290 points)
0 votes

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RTPCListener : MonoBehaviour {


    //set your RTPCID to the name of your desired gameparameter (under GameSyncs)
    public string rtpcID;

    // Update is called once per frame
    void Update () {

        // RTPCValue_type.RTPCValue_Global
        // for whatever reason, this constant isn't exposed by name by WWise C#/Unity headers
        int type = 1;

        // will contain the value of the RTPC parameter after the GetRTPCValue call
        float value;

        // retrieves current value of the RTPC parameter and stores it in 'value'
        AkSoundEngine.GetRTPCValue( rtpcID, gameObject, 0, out value, ref type );

        //
        // use 'value' here
        //
        // e.g. transform.localScale += Vector3( value, 0, 0 );
        // which would scale by the value of the RTPC parameter
}

answered Jan 19, 2018 by Kristina W. (490 points)
...