//
// sub_10061FC74 from 0x10061fc74 to 0x10061fd38 (196 bytes)
//
// 2 xrefs:
// > sub_10061F48C @ 0x10061f640
// > sub_10061FDEC @ 0x10061fdec
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:10:18 +0000
//
__int64 __fastcall sub_10061FC74(__int64 a1, __int64 a2, AudioQueueBuffer *a3)
{
UInt32 v3; // w9
__int64 result; // x0
UInt32 v7; // w8
UInt32 ioNumPackets; // [xsp+8h] [xbp-18h] BYREF
UInt32 ioNumBytes; // [xsp+Ch] [xbp-14h] BYREF
v3 = *(_DWORD *)(a1 + 464);
ioNumPackets = 1;
ioNumBytes = v3;
if ( *(_BYTE *)(a1 + 504) )
return 0;
if ( !AudioFileReadPacketData(
*(AudioFileID *)(a1 + 408),
0,
&ioNumBytes,
a3->mPacketDescriptions,
*(unsigned int *)(a1 + 508),
&ioNumPackets,
a3->mAudioData) )
{
v7 = ioNumPackets;
if ( ioNumPackets )
{
a3->mAudioDataByteSize = ioNumBytes;
a3->mPacketDescriptionCount = v7;
result = AudioQueueEnqueueBuffer(*(AudioQueueRef *)(a1 + 480), a3, 0, nullptr);
if ( !(_DWORD)result )
{
*(_DWORD *)(a1 + 508) += ioNumPackets;
return result;
}
}
else
{
result = AudioQueueFlush(*(AudioQueueRef *)(a1 + 480));
if ( !(_DWORD)result )
{
*(_BYTE *)(a1 + 504) = 1;
return result;
}
}
}
return 28;
}