menu
 

AudiokineticのコミュニティQ&AはWwiseやStrataのコミュニティ内でユーザ同士が質問・回答をし合うことができるフォーラムです。Audiokineticテクニカルサポートチームからの回答をご希望の場合は、必ず サポートチケットページ をご利用ください。

+1 支持

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"
 
 
 
Florent D. (470 ポイント) General Discussion
Florent D. 編集

回答 5

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

Thanks!
Jean-Edouard M. (370 ポイント)
+1 支持
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
Florent D. (470 ポイント)
+1 支持
 
ベストアンサー
Adrien L. (Audiokinetic) (1.1k ポイント)
0 支持

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

 

Ratko F. (290 ポイント)
0 支持

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
}

Kristina W. (490 ポイント)
...