SteamUser.DecompressVoice with byte

This commit is contained in:
Garry Newman 2019-05-08 14:52:16 +01:00
parent 0342f8a712
commit 60377c9c5b

View File

@ -256,6 +256,29 @@ public static unsafe int DecompressVoice( System.IO.Stream input, int length, Sy
return (int)szWritten;
}
public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output )
{
var to = Helpers.TakeBuffer( 1024 * 64 );
uint szWritten = 0;
fixed ( byte* frm = from )
fixed ( byte* dst = to )
{
if ( Internal.DecompressVoice( (IntPtr)frm, (uint)from.Length, (IntPtr)dst, (uint)to.Length, ref szWritten, SampleRate ) != VoiceResult.OK )
return 0;
}
if ( szWritten == 0 )
return 0;
//
// Copy to output buffer
//
output.Write( to, 0, (int)szWritten );
return (int)szWritten;
}
/// <summary>
/// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
/// </summary>