|
Post by tango9jeff on Sept 17, 2014 23:29:33 GMT
Hello,
Thanks for the great product! I'm really enjoying learning how to use it in my projects.
I've got a problem with Audio Zones. I need to have more control over my environments so I'm creating audio zones using Collider based sections in my world. One example of this would be separating the Outdoor mix of a Nature scene in contrast to walking indoors into a building or house for a change in multiple files. I'll try to list out my problems below simply:
1. No Volume Fade in control for "OnTriggerEnter" event types. By adding two event instances I can control the initialization of the play audio and then the fade out as I leave the Trigger area but I can't control the entry volume fade of the Play audio.
2. I have to load multiple instances of the "Event" panel in order to handle multiple functions on one GameObject. It would be nice if I only needed to load one instance of "Add Event" and I could setup a OnTriggerEnter Event and simply add another Event in the same way I can add a new "Action". As of now I have to add two instances to each Audio zone in produce a Enter and Exit Trigger functionality.
I've tried to combat this by creating Additional actions both before and after the Play audio Action with "Group Control "Fade to Volume" but for some reason this is not working? Not sure if I'm doing something wrong here or not.
An option to add a Fade In/Out to each audio Action would be very nice and helpful so I could control what happens when a player crosses the Trigger zone. Also being able to add multiple events to one panel instance per Object would be great as well. I hope you can give me assistance here.
Thanks so much and I am really enjoying your design here! Great job!
Jeff
|
|
|
Post by DarkTonic Dev on Sept 18, 2014 2:00:06 GMT
#1, it's not called fade in, but can't you use "fade to volume"? On the group control from Event Sounds?
You are saying that you can't use 2 different events on a single Event Sounds component? That's a bug if so. Could you send me steps to reproduce the error?
I don't understand what you're asking for about the fade functionality though.
|
|
|
Post by tango9jeff on Sept 22, 2014 22:16:34 GMT
Hey,
Thanks for the reply. I'm unable to get an audio clip to "Fade to volume" on an "On Trigger Enter" event. I've tried doing it both ways. First Adding a play Sound to a trigger event and then a Fade to volume action after it Or a fade to volume action then Play Sound for an On Trigger Enter and either way I cannot get the volume to smoothly fade in. I've also tried using only a "Fade volume to" with the sound assigned but nothing plays.
I can however get the volume of the file to fade out fine using an On Trigger Exit event. So if I've told a file to play upon entering a trigger the file plays and then fades out in volume as I exit the trigger but I cannot achieve the same effect for getting a smooth fade In for On Trigger Enter. Perhaps I'm doing something wrong?
Thanks!
|
|
|
Post by DarkTonic Dev on Sept 23, 2014 2:38:15 GMT
Not sure, it works for me. I just tried this:
Example Scene "StandaloneScene".
1) Set Scream group's variation to loop (just so it's a longer sound). 2) Set "player" Trigger Enter event on EventSounds to play Scream sound (action #1). Action #2 is Fade To Volume to zero volume over 1 second. 3) Turn "is trigger" on for the player. 4) I made the player invisible after hitting play. The scream sound does fade out.
However, I noticed that there's a bug where the sound won't play again because the loop setting doesn't ever let it end even though it's at zero volume.
Now you know you can set up a custom fade out in the Variation itself right? Fading the group volume to a new volume will mean that subsequent plays of that group will be at the new volume. If that volume is zero, they won't be audible.
|
|
|
Post by tango9jeff on Sept 25, 2014 1:56:35 GMT
Thanks for looking into it for me.
But I am able to get audio to fade out fine. The problem is that I cannot reproduce a Sound to be able to Fade in. I want the assigned sound on a OnTriggerEnter to start at 0 and gradually raise to 1 over a designated fade in time. Are you able to get that to work?
Thanks!
|
|
|
Post by DarkTonic Dev on Sept 25, 2014 14:33:40 GMT
It's working properly, I just tested it. It's due to a misunderstanding that you think it's not working. Here's how it works when you do those 2 actions in a row.
1) Play a sound at volume X (let's say 0). Zero is the volume that the randomly chosen Variation will be played at. 2) You tell the GROUP to fade in from 0 to 1, not the Variation. A Sound Group has its own volume.
The volume of any SFX is: Variation Volume times Sound Group Volume times Bus Volume (if any bus) times Master Mixer Volume.
So actually if you play a sound at a Variation Volume of zero, changing the Group volume will have no effect - the resulting volume will still be zero (0 * 1 * 1 = 0), assuming no bus. It will not fade in.
You would probably be best off just defining the custom fade in time on the Variation itself. You can define a Variation that's the same as another sound Variation in the same Sound Group, except that it has custom fading. Then you play it by name.
Or if you're scripting, you can call the FadeToVolume method on the SoundGroupVariation, which actually changes the Variation volume.
Or you can set the group volume to zero before playing the sound, then play the Variation at full volume and fade in the group - this of course isn't ideal if you have other Variations already playing in that Group because they'll suddenly be at zero volume.
|
|
|
Post by DarkTonic Dev on Sept 25, 2014 14:33:42 GMT
It's working properly, I just tested it. It's due to a misunderstanding that you think it's not working.
The volume of any SFX is, at any time, calculated like this: (Variation Volume) X (Sound Group Volume) X (Bus Volume if any bus) X (Master Mixer Volume). Here's how it works when you do those 2 actions in a row.
1) Play a sound at volume X (let's say 0). Zero is the volume that the randomly chosen Variation will be played at. 2) You tell the GROUP to fade in from 0 to 1, not the Variation. A Sound Group has its own volume.
So actually if you play a sound at a Variation Volume of zero, changing the Group volume will have no effect - the resulting volume will still be zero as the calculation change from (0 X 0 X 1) to (0 X 1 X 1 = 0), assuming no bus - notice the middle number, which is the Group volume is the one that changes. It will not fade in audibly but remain at zero volume during the entire fade. But you can watch the Group's volume move in the Inspector so you know it's working.
A couple options for you:
1) Just define the custom fade in time on the Variation itself. You can define a Variation that's the same as another sound Variation in the same Sound Group, except that it has custom fading. Then you play it by name. You can have as many of these as you like, it takes no extra memory.
2) If you're scripting, you can call the FadeToVolume method on the SoundGroupVariation, which actually changes the Variation volume.
3) You can set the group volume to zero before playing the sound, then play the Variation at full volume and fade in the group - this of course isn't ideal if you have other Variations already playing in that Group because they'll suddenly be at zero volume.
I will see about providing a way to tell a SFX to fade in by adding parameters for fade in right in the PlaySound call.
Hope that helps!
|
|
|
Post by tango9jeff on Oct 3, 2014 20:22:16 GMT
Thanks for your reply and sorry for my delay! I was able to get it working right as you mentioned by adjusting the fade in of the actual Soundgroup rather than messing with it on the Event Actions.
Thanks for that! =)
|
|
|
Post by DarkTonic Dev on Oct 5, 2014 8:28:15 GMT
No problem.
|
|