コミュニティQ&A

Audiokineticのコミュニティ主導のQ&Aフォーラムへようこそ。ここはWwiseとStrataのユーザのみなさまがお互いに協力し合う場です。弊社チームによる直接のサポートをご希望の場合はサポートチケットページをご利用ください。バグを報告するには、Audiokinetic LauncherのBug Reportオプションをご利用ください。(Q&AフォーラムではBug Reportを受け付けておりませんのでご注意ください。専用のBug Reportシステムをご利用いただくことで、バグの報告が適切な担当部門に届き、修正される可能性が高まります。)

最適な回答を迅速に得られるよう、ご質問を投稿される際は以下のヒントをご参考ください。

  • 具体的に示す:何を達成したいのか、またはどんな問題に直面しているのかを具体的に示してください。
  • 重要な詳細情報を含める:Wwiseとゲームエンジンのバージョンやご利用のOSなど詳細情報を記載してください。
  • 試したことを説明する:すでに試してみたトラブルシューティングの手順を教えてください。
  • 事実に焦点を当てる:問題の技術的な事実を記載してください。問題に焦点を当てることで、ほかのユーザのみなさまが解決策を迅速に見つけやすくなります。

0 支持
Everything seems to work correctly.But my rtpcValue won't update from default.

I am able to set my rtpc value through SetRTPCValue.
I can hear that the RTPC is working.
GetRTPCValue accapts my default value.
AKRESULT is debugging me "successfull"
I am using the RTPCValue_Global type, which should ignore both in_gameObjectID and in_playingID.

But still my float rtpcValue won't update. Have anybody encountered that problem before?

This is my code:

    float rtpcValue;
    public string rtpcID = "rtpc_sunrise";
    public string in_playingID;
    int type1 = 1;

  void Update ()
    {

        if (Input.GetKey(KeyCode.Alpha7))
        {
            AkSoundEngine.SetRTPCValue(rtpcID, 0);
        }

        if (Input.GetKey(KeyCode.Alpha8))
        {
            AkSoundEngine.SetRTPCValue(rtpcID, 90);
        }

        AKRESULT result = AkSoundEngine.GetRTPCValue(rtpcID, gameObject, 0, out rtpcValue, ref type1);
        Debug.Log("Reult: " + result.ToString() + " value " + rtpcValue);
    }
M. Riddersholm (230 ポイント) General Discussion

回答 1

0 支持

Hi,

the AkSoundEngine.GetRTPCValue function can modify the value of your type1 variable if the value is not found on the scope requested, which probably happens on your first Update() execution since the RTPC doesn't seem to be assigned yet.

Since the scope of that variable is bigger than the Update function, all future GetRTPCValue calls will be made with the incorrect type1 value, most likely requesting the DefaultValue instead of the GlobalValue.

 

I would advise declaring that variable inside the scope of your Update function and preferably right before using it, like so:

 

void Update()

{

    ...

 

    int valueType = (int)AkQueryRTPCValue.RTPCValue_Global;  // 1 like your type1 variable

    AKRESULT result = AkSoundEngine.GetRTPCValue(rtpcID, null, 0, out rtpcValue, ref valueType);

}

 

If you want to confirm this, you can output the value of your type1 variable in your log along with the rtpc value

Cheerz

Martin S. (590 ポイント)
Hi Martin

Thank you for the answer.

I figured it out myself, with the help of my programmor.
But I didn't manage to figure out why excatly RTPCtype is set with a ref in the GetRTPCValue method.
Why excatly is that? why would you ever need the type to be set to default by itself?
The function starts by trying to find the rtpc value at the scope requested. If the value is not found, it tries a more general scope until it finds it.

Once the function returns, you can test valueType again to know the scope of the value returned.
...