Closed AndrewBJ closed 2 years ago
Thank you. I updated the following files:
Tony.
A few more places in XAudio2:
Line 405:
XAUDIO2_SEND_DESCRIPTOR = record
Flags: UINT32; // Either 0 or XAUDIO2_SEND_USEFILTER.
pOutputVoice: PIXAudio2Voice; // <<--- Should be IXAudio2Voice
end;
Line 608:
function CreateSourceVoice(out ppSourceVoice: IXAudio2SourceVoice;
pSourceFormat: PWAVEFORMATEX; // <<--- Should be PWAVEFORMATEX
Line 690:
procedure SetDebugConfiguration(pDebugConfiguration: XAUDIO2_DEBUG_CONFIGURATION; // <<--- Should be PXAUDIO2_DEBUG_CONFIGURATION
pReserved: Pointer = nil); stdcall;
Line 747 (class IXAudio2Voice):
754:
procedure GetVoiceDetails(out pVoiceDetails: XAUDIO2_VOICE_DETAILS); virtual; stdcall; abstract; // <<--- Skipped <out>
762:
function SetOutputVoices(pSendList: XAUDIO2_VOICE_SENDS): HRESULT; virtual; stdcall; abstract; // <<--- PXAUDIO2_VOICE_SENDS
769:
function SetEffectChain(pEffectChain: XAUDIO2_EFFECT_CHAIN): HRESULT; virtual; stdcall; abstract; <<--- PXAUDIO2_EFFECT_CHAIN
833:
function SetFilterParameters(pParameters: XAUDIO2_FILTER_PARAMETERS; // <<--- PXAUDIO2_FILTER_PARAMETERS
850:
function SetOutputFilterParameters(pDestinationVoice: IXAudio2Voice;
pParameters: XAUDIO2_FILTER_PARAMETERS; // <<--- PXAUDIO2_FILTER_PARAMETERS
Line 984:
function SubmitSourceBuffer(pBuffer: XAUDIO2_BUFFER; // <<--- PXAUDIO2_BUFFER
Thanks a lot for fixing sources. But there are the new wrong translations occurs: Any "out" parameter must be a static type in the code. "out" already send it by pointer.
for example PType=^TType (param: PType) and (out param: TType) are equivalent
I hope that the next fixes will be the last
754: GetVoiceDetails(out pVoiceDetails: XAUDIO2_VOICE_DETAILS) // not PXAUDIO2_VOICE_DETAILS because used "out"
841: GetFilterParameters(out pParameters: XAUDIO2_FILTER_PARAMETERS)
861: procedure GetOutputFilterParameters(pDestinationVoice: IXAudio2Voice; out pParameters: XAUDIO2_FILTER_PARAMETERS); virtual; stdcall; abstract;
Thanks a lot for fixing sources. But there are the new wrong translations occurs: Any "out" parameter must be a static type in the code. "out" already send it by pointer.
for example PType=^TType (param: PType) and (out param: TType) are equivalent
I hope that the next fixes will be the last
754: GetVoiceDetails(out pVoiceDetails: XAUDIO2_VOICE_DETAILS) // not PXAUDIO2_VOICE_DETAILS because used "out"
841: GetFilterParameters(out pParameters: XAUDIO2_FILTER_PARAMETERS)
861: procedure GetOutputFilterParameters(pDestinationVoice: IXAudio2Voice; out pParameters: XAUDIO2_FILTER_PARAMETERS); virtual; stdcall; abstract;
I hope so too. thank you!
Any "out" parameter must be a static type in the code. "out" already send it by pointer.
I Know, but not always. When the annotation is [out] followed by a pointer, [out] is commented out as {out} . Some times it's confusing to translate C++ pointers to Delphi equivalents, because Delphi treats params as pointers internally. That's why in the original code static arrays were implemented as an option if a developer doesn't want to get involved with pointers. An interesting article about this is published by Rudi Velthuis Pitfalls of converting. We tested this behavior within different Api's, and it works. As a purist I would go for pointer use, but it's not really necessary as has been tested with compilers since XE2.
Greetings, Tony.
The classes in XAudio2 should be interfaced, as has been done in the latest update.
Unit WinApi.DirectX.XAudio2.XAudio2:417
The problem of field XAUDIO2_VOICE_SENDS.pSends. It should be Pointer, not a static array
https://docs.microsoft.com/en-us/windows/win32/api/xaudio2/ns-xaudio2-xaudio2_voice_sends
Proposed changes:
XAUDIO2_EFFECT_CHAIN has the same problem