Questions et réponses de la communauté

Bienvenue sur le forum de questions et réponses d'Audiokinetic, propulsé par la communauté. C'est l'endroit où les utilisateurs de Wwise et Strata s'entraident. Pour obtenir une aide directe de notre équipe, veuillez utiliser la page « Tickets de soutien ». Pour signaler un bug, utilisez l'option Bug Report dans l'Audiokinetic Launcher. (Veuillez noter que les rapports de bug soumis au forum questions-réponses seront rejetés. L'utilisation de notre système de rapport de bug dédié garantit que votre rapport est vu par les bonnes personnes et a les meilleures chances d'être corrigé.)

Pour obtenir rapidement les meilleures réponses, suivez ces conseils lorsque vous posez une question :

  • Soyez précis : qu'essayez-vous de réaliser ou quel est le problème spécifique que vous rencontrez ?
  • Pensez à inclure les détails importants : incluez des détails tels que les versions de Wwise et du moteur de jeu, le système d'exploitation, etc.
  • Expliquez ce que vous avez essayé de faire : indiquez aux autres les mesures que vous avez déjà prises pour essayer de résoudre le problème.
  • Concentrez-vous sur les faits : décrivez les aspects techniques de votre problème. Se concentrer sur le problème aide les autres personnes à trouver rapidement une solution.

0 votes
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?
dans General Discussion par Pete B. (290 points)

1 Réponse

+1 vote
 
Meilleure réponse

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!

par Mads Maretty S. (Audiokinetic) (40.2k points)
sélectionné par 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.
...