Re: Expose more MiniAudio-Functions
Posted: Tue Sep 09, 2025 3:05 pm
It is possible that in this code the structures from C to PB are incorrectly translated.
Test code.The application crashes.
When I checked ma_context structure size in Visual Studio I found out that in x86 the size is 386 bytes, and in x64 the size is 720 bytes. But in PB the size is different. in x86 the size is 136 bytes, and in x64 the size is 232 bytes.
I haven't checked the size of the other structures, but it might also be incorrect.
Or maybe the miniaudio version is different and this code is for an older version where the structures were smaller.
Test code.
Code: Select all
XIncludeFile "miniaudio.pbi"
EnableExplicit
Procedure GetDevList(List Dev.s())
Protected Res = #False, context.ma_context
If ma_context_init(#Null, 0, #Null, @context) = #MA_SUCCESS
EndIf
ProcedureReturn Res
EndProcedure
Define NewList Dev.s()
GetDevList(Dev())
ForEach Dev()
Debug Dev()
Next
When I checked ma_context structure size in Visual Studio I found out that in x86 the size is 386 bytes, and in x64 the size is 720 bytes. But in PB the size is different. in x86 the size is 136 bytes, and in x64 the size is 232 bytes.
I haven't checked the size of the other structures, but it might also be incorrect.
Or maybe the miniaudio version is different and this code is for an older version where the structures were smaller.