|
Post by theleast on Mar 15, 2015 2:18:58 GMT
This may be more than MasterAudio (or I) can handle...
I'm using various MasterAudio groups with Behaviour Designer to play random barks (short voice clips) for enemies, depending on their AI state ("Human sighted!", "Under attack!" etc.). I want a pair of lights on the enemy's head to flash in conjunction with the volume of the audio clip, to show which enemy is speaking. To do this, I have an emissive channel on the enemy's Standard Shader, but I need a way to monitor the volume of the audio clip being played and use it to drive the value of the emissive channel. Is it possible to do this dynamically with MasterAudio, or am I going to need to create custome animations for every clip?
For reference, here's the effect I'm aiming for:
Thanks!
|
|
|
Post by DarkTonic Dev on Mar 15, 2015 5:37:25 GMT
If you play the sound from code, you'll be able to monitor the volume, pitch and whatever else you want from the Audio Source.
var screamSource = MasterAudio.PlaySound3D("Scream"); if (screamSource.ActingVariation != null) { var vol = screamSource.ActingVariation.audio.volume; // now you have the volume, do something with it! }
I couldn't tell you how to integrate that with Behavior Designer and it may not even be possible to do so.
|
|