//
// FMODAudioEngine::fadeOutMusic from 0x3ef5d0 to 0x3ef68a (186 bytes)
//
// 3 xrefs:
// > PlayLayer::showCompleteEffect @ 0x40360a
// > LevelAreaInnerLayer::onDoor @ 0x6a4448
// > GJPathPage::playUnlockAnimation @ 0x6d2652
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:47:12 +0000
//
void __fastcall FMODAudioEngine::fadeOutMusic(FMODAudioEngine *this, float a2, unsigned int a3)
{
FMOD::Channel *ActiveMusicChannel; // r0
FMOD::ChannelControl *v6; // r6
float Fade; // r8
unsigned __int64 v8; // [sp+8h] [bp-10h] BYREF
ActiveMusicChannel = (FMOD::Channel *)FMODAudioEngine::getActiveMusicChannel(this, a3);
v6 = ActiveMusicChannel;
if ( ActiveMusicChannel )
{
Fade = FMODAudioEngine::stopAndGetFade(this, ActiveMusicChannel);
*((_DWORD *)this + 97) = FMOD::ChannelControl::getDSPClock(v6, nullptr, &v8);
ERRCHECK_fn();
*((_DWORD *)this + 97) = FMOD::ChannelControl::addFadePoint(v6, v8, Fade);
ERRCHECK_fn();
*((_DWORD *)this + 97) = FMOD::ChannelControl::addFadePoint(
v6,
(unsigned __int64)(float)((float)v8 + (float)((float)*((int *)this + 98) * a2)),
0.0);
ERRCHECK_fn();
}
}