Rain and Thunder

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
pango
Posts: 2172
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Rain and Thunder

Post by pango » Fri Dec 21, 2018 7:21 am

Hi all,
I tried to give AmbienEffectsPlayer two (Daggerfall)AudioSources, a separate one for looping effects so it could play rain and thunder simultaneously.
But so far I don't get the expected results, the way to use components still eludes me...
My best shot so far: https://github.com/Interkarma/daggerfal ... nd-thunder
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 5183
Joined: Sun Mar 22, 2015 1:51 am

Re: Rain and Thunder

Post by Interkarma » Fri Dec 21, 2018 7:41 am

I believe we'd need to re-work the AmbientEffectsPlayer itself to support a separate AudioSource (normal Unity one) for looping ambient effects and it can then play intermittent effects the usual way.

When I wrote this, for some reason I never considered rain and thunder playing at the same time. In hindsight it's rather blindingly obvious I should have done this in the first place. :(

User avatar
pango
Posts: 2172
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Rain and Thunder

Post by pango » Fri Dec 21, 2018 5:07 pm

Interkarma wrote:
Fri Dec 21, 2018 7:41 am
I believe we'd need to re-work the AmbientEffectsPlayer itself to support a separate AudioSource (normal Unity one) for looping ambient effects and it can then play intermittent effects the usual way.
That's what I tried to do, but failed...
I split the class in AmbientEffectsPlayer and AmbientLoopEffectsPlayer so I could inject a different AudioSource in each, yet I suspect they're still shared because rain sound changes volume and spatialization after thunder sound has been played...
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Post Reply