playMaker

Author Topic: Override all audio briefly 'ducking' - 'Flash bang' audio effect[SOLVED]  (Read 1424 times)

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Hi Playmakers,

I need to have a 'Flashbang' effect (like in Counterstrike). When the player is hit by a particular explosion I need all the audio to immediately go silent, while a ringing effect is the only thing that can be heard.

Over a few seconds, the ringing audio will gradually decrease down while the regular audio gradually increases back up to normal.

There must be a simple way to turn all audio down except for a specific audio source, then turn all audio back up once the effect has worn off.

Any recommendations?

Thanks!
« Last Edit: December 05, 2018, 01:17:10 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Override all audio briefly - 'Flash bang' audio effect
« Reply #1 on: December 04, 2018, 12:38:32 AM »
Hi,

 well, for this I think you'll need a proper sound system framework to allow for easy controls of sounds by group.

Master Audio is probably the best choice, and it has PlayMaker support. I would enquire with the author to check that what you want is feasible.

https://assetstore.unity.com/packages/tools/audio/master-audio-aaa-sound-5607

else, the custom way would be to fire a global event "FLASH BANG STARTED" so that many fsm can react and lower the volume of their respective audio, and then "FLASH BAND END" for audio to resume to regular volume, that would work too.

 Bye,

 Jean

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Override all audio briefly - 'Flash bang' audio effect
« Reply #2 on: December 04, 2018, 04:13:07 AM »
I don’t know how to do this, but I know the technical term is “ducking”:
https://en.wikipedia.org/wiki/Ducking

Master Audio has “audio ducking”, lowering the volume of other sounds while one sound is active, though I never used it. But Unity appears to have it built-in, too, see tutorial below.

Unity Tutorial:
https://unity3d.com/learn/tutorials/topics/audio/duck-volume-audio-effect
« Last Edit: December 04, 2018, 04:17:36 AM by Thore »

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Override all audio briefly - 'Flash bang' audio effect
« Reply #3 on: December 04, 2018, 01:30:57 PM »
Both great suggestions - thank you very much!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Override all audio briefly - 'Flash bang' audio effect
« Reply #4 on: December 05, 2018, 01:16:22 AM »
Hi,

 ok cool, I learned something! thanks Thore :) I am so behind with audio... I never use it in real projects...

 Bye,

 Jean