EverestAPI / CelesteTAS-EverestInterop

Everest interop for DevilSquirrel's CelesteTAS
https://github.com/EuniverseCat/CelesteTAS
MIT License
67 stars 28 forks source link

Don't play sounds when they are 'auto-muted' (fast-forwarding) #12

Closed maddie480 closed 3 years ago

maddie480 commented 3 years ago

This PR changes the "auto-mute" class so that it doesn't play sounds by not calling orig methods, instead of playing the sounds but muted. When the method should return an EventInstance, we return a shared instance of an existing vanilla sound that is silent unless you set the proper audio params on it (the footstep sound). SoundSource.Play returns self, since the original method does the same (it returns this).

This was done after reports of freezes during fast-forwarding: the freeze points were calls to FMOD, that eventually get stuck. FMOD getting overloaded can actually be heard, since music progressively stutters / gets distorted before eventually becoming silent - and that's when the fast forward starts freezing as well.

maddie480 commented 3 years ago

I just tried this: if I remove that, you can actually hear some sounds 😕 ambience, cassette block clicks, and some other sound I can't really identify. Here is a comparison on the same TAS file (the one Cr33pyCat gave me, where I placed a breakpoint randomly):

DemoJameson commented 3 years ago

Oh, so there are some sounds that we don't address, but I think it's good enough.