コミュニティQ&A

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

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

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

0 支持
WWise Ver: 2019.2.5

Unity Ver: 2019.4.8f1

Hello,

I have a Unity scene which plays some background music, and has an object in it which plays some spatial music via the AkAmbient component.

I want to fade the background music out as the player gets close to the object, and then fade the background music back in when they move away from it. My goal therefore is to have it so both pieces of music can be heard without them clashing together.

I've tried auto-ducking by using buses. This doesnt work because the spatial audio is set to 'Trigger On: Start' so as soon as the scene starts the background music ducks out before the player is close to the object. I've also tried changing to 'Trigger On: AkTriggerEnter' which works better - but then the background music never resumes because I assume once triggered the AkAmbient bus just stays active.

What can I do to get the behaviour I want?
Pete B. (290 ポイント) General Discussion

回答 1

+1 支持
 
ベストアンサー

Hey Pete, 

There's quite a few ways to do this, but I would probably use busses with some adjustments. 

I noticed you write... 
"as soon as the scene starts the background music ducks out before the player is close to the object."
- Do you have attenuation on the non-background music? Ducking should definitely not duck, unless something is actually playing through it. Alternatively, you could try attaching a Wwise Meter to the non-background music bus, and then connect the RTPC from it, to the volume of the background music. 

Another less "volume-based" solution could also be to set an RTPC based on how close you are to the non-background music and map it to the volume of the background music bus. This should work quite well, as the RTPC influence will only subtract volume from the background music's audio bus, and so you can still have like a volume control RTPC on it as well. 
- You can do that by creating a new script, and in your Update() function, set the RTPC to the Vector3.Distance(transform.position, playertransform.position). 

If you want to see how this could be implemented, then for the Audio Bus ducking solution you can check out the arcade machine in WAG, that does exactly the same for the main music when it plays. For the method of setting an RTPC in Update, there's a section in Wwise 301 that describes more about that. 

Let me know if this helps!

Mads Maretty S. (Audiokinetic) (40.2k ポイント)
Pete B. 選択
Hey there. Thanks, I'll give those ideas a bit of research.

Quick note though - in WAG the arcade machine doesn't do anything for me. I get an interact prompt, which does nothing, and certainly no sound is heard.
"then for the Audio Bus ducking solution you can check out the arcade machine in WAG, that does exactly the same for the main music when it play"

Can you screen shot where in WWise the ducking is setup? I'm having a look at the project in WWise but I'm feeling quite lost.
In the end I went for the script option and setting the RTPC that way. I would love to know the other ways of doing this by using audio buses, but I was unable to figure it out.

In this case, the WAM wasn't helpful. The example of the arcade machine simply doesn't work for me (it never makes any sound when playing the game)and also I noticed the setup of the arcade machine is on interact which involves start and stop events. This is different to my scenario; I have an AKAmbient component which simply has a 'Trigger On: Start' setting. There is no notion of stopping it.
...