diff --git a/Facepunch.Steamworks/Client.Voice.cs b/Facepunch.Steamworks/Client/Voice.cs
similarity index 76%
rename from Facepunch.Steamworks/Client.Voice.cs
rename to Facepunch.Steamworks/Client/Voice.cs
index 5a9a155..6ed87dc 100644
--- a/Facepunch.Steamworks/Client.Voice.cs
+++ b/Facepunch.Steamworks/Client/Voice.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
@@ -110,5 +111,35 @@ internal unsafe void Update()
IsRecording = false;
}
}
+
+ public unsafe bool Decompress( byte[] input, int inputoffset, int inputsize, MemoryStream output, uint samepleRate = 0 )
+ {
+ if ( samepleRate == 0 )
+ samepleRate = OptimalSampleRate;
+
+ //
+ // Guessing the uncompressed size cuz we're dicks
+ //
+ {
+ var targetBufferSize = inputsize * 10;
+
+ if ( output.Capacity < targetBufferSize )
+ output.Capacity = targetBufferSize;
+
+ output.SetLength( targetBufferSize );
+ }
+
+ fixed ( byte* pout = output.GetBuffer() )
+ fixed ( byte* p = input )
+ {
+ uint bytesOut = 0;
+ var result = (Valve.Steamworks.EVoiceResult) client.native.user.DecompressVoice( (IntPtr)( p + inputoffset ), (uint) inputsize, (IntPtr) pout, (uint) output.Length, ref bytesOut, (uint)samepleRate );
+
+ if ( bytesOut > 0 )
+ output.SetLength( bytesOut );
+
+ return result == Valve.Steamworks.EVoiceResult.k_EVoiceResultOK;
+ }
+ }
}
}
diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.csproj
index b0b1cb0..5dce677 100644
--- a/Facepunch.Steamworks/Facepunch.Steamworks.csproj
+++ b/Facepunch.Steamworks/Facepunch.Steamworks.csproj
@@ -117,7 +117,6 @@
-
@@ -125,6 +124,7 @@
+