//
// FMODAudioEngine::setChannelPitch from 0x140059180 to 0x140059282 (258 bytes)
//
// 5 xrefs:
// > FMODAudioEngine::updateChannelTweens @ 0x1400568d6
// > FMODAudioEngine::updateChannel @ 0x140058c35
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244afd
// > GJBaseGameLayer::processSongState @ 0x140245787
// > ??> @ 0x1406c5214
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void FMODAudioEngine::setChannelPitch(FMODAudioEngine *a1, int a2, AudioTargetType a3, float a4)
{
FMOD::ChannelGroup *ChannelGroup; // rax
FMOD::ChannelControl *v6; // rax
int v7; // edx
_BYTE v8[16]; // [rsp+20h] [rbp-28h] BYREF
int v9; // [rsp+58h] [rbp+10h] BYREF
int v10; // [rsp+60h] [rbp+18h] BYREF
v9 = a2;
if ( a3 == SFXGroup )
{
*(float *)(*(_QWORD *)sub_140060B20(&a1->m_audioState.m_pitchForEffectGroups, v8, &v9) + 20LL) = a4;
ChannelGroup = FMODAudioEngine::getChannelGroup(a1, v9, 0);
FMOD::ChannelControl::setPitch(ChannelGroup, a4);
v6 = FMODAudioEngine::getChannelGroup(a1, v9, 1);
LABEL_9:
FMOD::ChannelControl::setPitch(v6, a4);
return;
}
if ( a3 == MusicChannel )
{
*(float *)(*(_QWORD *)sub_140060B20(&a1->m_audioState.m_pitchForMusicChannels, v8, &v9) + 20LL) = a4;
v10 = v9;
if ( sub_14005F8D0(&a1->m_fmodMusic, &v10) )
v7 = *(_DWORD *)(*(_QWORD *)sub_140061560(&a1->m_fmodMusic, v8, &v10) + 24LL);
else
v7 = 0;
}
else
{
*(float *)(*(_QWORD *)sub_140060B20(&a1->m_audioState.m_pitchForEffectChannels, v8, &v9) + 20LL) = a4;
v7 = v9;
}
v6 = FMODAudioEngine::channelForChannelID(a1, v7);
if ( v6 )
goto LABEL_9;
}