mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 07:05:50 +03:00
SteamUser.DecompressVoice with byte
This commit is contained in:
parent
0342f8a712
commit
60377c9c5b
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user