mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-26 13:31:17 +03:00
Added IntPtr version of DecompressVoice
This commit is contained in:
parent
b813ee7a17
commit
9b487aae0e
@ -261,6 +261,9 @@ namespace Steamworks
|
|||||||
return (int)szWritten;
|
return (int)szWritten;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lazy version
|
||||||
|
/// </summary>
|
||||||
public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output )
|
public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output )
|
||||||
{
|
{
|
||||||
var to = Helpers.TakeBuffer( 1024 * 64 );
|
var to = Helpers.TakeBuffer( 1024 * 64 );
|
||||||
@ -284,6 +287,22 @@ namespace Steamworks
|
|||||||
return (int)szWritten;
|
return (int)szWritten;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Advanced and potentially fastest version - incase you know what you're doing
|
||||||
|
/// </summary>
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
|
/// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user