//
// FMODAudioEngine::createStream from 0x2ff290 to 0x2ff382 (242 bytes)
//
// 1 xrefs:
// > FMODAudioEngine::preloadMusic @ 0x303406
//
// 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::Sound *__fastcall FMODAudioEngine::createStream(int a1, const char **a2)
{
cocos2d::CCFileUtils *v4; // r0
cocos2d::CCString *v5; // r0
char *CString; // r0
bool v7; // zf
FMOD::System *v8; // r0
FMOD_SOUND_TYPE v9; // r3
FMOD::Sound *v10; // r4
const char *v12; // [sp+Ch] [bp-9Ch] BYREF
FMOD::Sound *v13; // [sp+10h] [bp-98h] BYREF
FMOD_CREATESOUNDEXINFO v14; // [sp+14h] [bp-94h] BYREF
v4 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(FMOD_CREATESOUNDEXINFO *, cocos2d::CCFileUtils *, const char *, _DWORD))v4->createCCArrayWithContentsOfFile)(
&v14,
v4,
*a2,
0);
sub_776584((int)&v12, (char *)v14.cbsize);
sub_774008(&v14);
if ( *((_DWORD *)v12 - 3) )
{
sub_775170(&v12);
if ( *v12 != 47 )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"file:///android_asset/%s",
*a2);
CString = (char *)cocos2d::CCString::getCString(v5);
sub_7753D4((int)&v12, CString);
}
}
memset(&v14, 0, sizeof(v14));
v14.cbsize = 144;
v7 = sub_7748A0((int)a2, ".ogg") == -1;
v8 = *(FMOD::System **)(a1 + 388);
if ( v7 )
v9 = FMOD_SOUND_TYPE_MEDIACODEC;
else
v9 = FMOD_SOUND_TYPE_OGGVORBIS;
v14.suggestedsoundtype = v9;
*(_DWORD *)(a1 + 408) = FMOD::System::createStream(v8, v12, 0x801400Au, &v14, &v13);
ERRCHECK_fn();
if ( *(_DWORD *)(a1 + 408) )
{
v10 = nullptr;
}
else
{
FMOD::Sound::setLoopCount(v13, 0);
v10 = v13;
}
sub_774008(&v12);
return v10;
}