diff --git a/csharp/FAudio.cs b/csharp/FAudio.cs index 0c017463f..97853961e 100644 --- a/csharp/FAudio.cs +++ b/csharp/FAudio.cs @@ -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)] diff --git a/extensions/DestroyVoiceSafeEXT.txt b/extensions/DestroyVoiceSafeEXT.txt new file mode 100644 index 000000000..13983c1b0 --- /dev/null +++ b/extensions/DestroyVoiceSafeEXT.txt @@ -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.