Skip to content

Commit

Permalink
DestroyVoiceSafeEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Mar 1, 2024
1 parent c00b01c commit a1f0540
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions csharp/FAudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ public static extern void FAudioVoice_DestroyVoice(
IntPtr voice /* FAudioVoice* */
);

[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint FAudioVoice_DestroyVoiceSafeEXT(
IntPtr voice /* FAudioVoice* */
);

/* FAudioSourceVoice Interface */

[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down
22 changes: 22 additions & 0 deletions extensions/DestroyVoiceSafeEXT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DestroyVoiceSafeEXT - Expose whether or not a voice was actually destroyed

About
-----
XAudio's function for exporting voices has the ability to fail - however, the
function declaration does not have a return value, so there is no way to safely
determine on the client side whether or not a voice was actually destroyed.
This extension adds a function that is otherwise identical, but includes a
result code to allow checking for failures.

Dependencies
------------
This extension does not interact with any non-standard XAudio features.

New Procedures and Functions
----------------------------
FAUDIOAPI uint32_t FAudioVoice_DestroyVoiceSafeEXT(FAudioVoice *voice);

How to Use
----------
This extension acts identially to the existing DestroyVoice, but with and added
return value - it will return 0 on success or non-0 on failure.

0 comments on commit a1f0540

Please sign in to comment.