Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

+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"
 
 
 
in General Discussion by Florent D. (470 points)
edited by Florent D.

5 Answers

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

Thanks!
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
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 ;)

 

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
}

by Kristina W. (490 points)
...