//
// FMODAudioEngine::waitUntilSoundReady from 0x2ff224 to 0x2ff288 (100 bytes)
//
// 2 xrefs:
// > FMODAudioEngine::setMusicTimeMS @ 0x3023d8
// > FMODAudioEngine::preloadMusic @ 0x30341c
//
// 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
//
FMOD_OPENSTATE FMODAudioEngine::waitUntilSoundReady(FMODAudioEngine *a1, FMOD::Sound *a2)
{
FMOD_OPENSTATE result; // r0
FMOD_OPENSTATE v5; // [sp+8h] [bp+0h] BYREF
if ( !a2 )
return FMOD_OPENSTATE_ERROR;
do
{
a1->m_lastResult = FMOD::Sound::getOpenState(a2, &v5, nullptr, nullptr, nullptr);
ERRCHECK_fn();
result = v5;
}
while ( v5 && v5 != FMOD_OPENSTATE_PLAYING && v5 != FMOD_OPENSTATE_ERROR );
return result;
}