diff --git a/Facepunch.Steamworks/SteamUser.cs b/Facepunch.Steamworks/SteamUser.cs
index d197687..e481d84 100644
--- a/Facepunch.Steamworks/SteamUser.cs
+++ b/Facepunch.Steamworks/SteamUser.cs
@@ -261,6 +261,9 @@ namespace Steamworks
return (int)szWritten;
}
+ ///
+ /// Lazy version
+ ///
public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output )
{
var to = Helpers.TakeBuffer( 1024 * 64 );
@@ -284,6 +287,22 @@ namespace Steamworks
return (int)szWritten;
}
+ ///
+ /// Advanced and potentially fastest version - incase you know what you're doing
+ ///
+ public static unsafe int DecompressVoice( IntPtr from, int length, IntPtr to, int bufferSize )
+ {
+ if ( length <= 0 ) throw new ArgumentException( $"length should be > 0 " );
+ if ( bufferSize <= 0 ) throw new ArgumentException( $"bufferSize should be > 0 " );
+
+ uint szWritten = 0;
+
+ if ( Internal.DecompressVoice( from, (uint) length, to, (uint)bufferSize, ref szWritten, SampleRate ) != VoiceResult.OK )
+ return 0;
+
+ return (int)szWritten;
+ }
+
///
/// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
///