Steamworks.SteamUser.GetVoice C# (CSharp) Method

GetVoice() public static method

Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to

DecompressVoice() for playback later as a binary blob. Uncompressed data is 16-bit, signed integer, 11025Hz PCM format.

Please note that the uncompressed data is not the raw feed from the microphone: data may only be available if audible

levels of speech are detected, and may have passed through denoising filters, etc.

This function should be called as often as possible once recording has started; once per frame at least.

nBytesWritten is set to the number of bytes written to pDestBuffer.

nUncompressedBytesWritten is set to the number of bytes written to pUncompressedDestBuffer.

You must grab both compressed and uncompressed here at the same time, if you want both.

Matching data that is not read during this call will be thrown away.

GetAvailableVoice() can be used to determine how much data is actually available.

If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate

public static GetVoice ( bool bWantCompressed, byte pDestBuffer, uint cbDestBufferSize, uint &nBytesWritten, bool bWantUncompressed, byte pUncompressedDestBuffer, uint cbUncompressedDestBufferSize, uint &nUncompressBytesWritten, uint nUncompressedVoiceDesiredSampleRate ) : EVoiceResult
bWantCompressed bool
pDestBuffer byte
cbDestBufferSize uint
nBytesWritten uint
bWantUncompressed bool
pUncompressedDestBuffer byte
cbUncompressedDestBufferSize uint
nUncompressBytesWritten uint
nUncompressedVoiceDesiredSampleRate uint
return EVoiceResult
		public static EVoiceResult GetVoice(bool bWantCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, bool bWantUncompressed, byte[] pUncompressedDestBuffer, uint cbUncompressedDestBufferSize, out uint nUncompressBytesWritten, uint nUncompressedVoiceDesiredSampleRate) {
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamUser_GetVoice(bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed, pUncompressedDestBuffer, cbUncompressedDestBufferSize, out nUncompressBytesWritten, nUncompressedVoiceDesiredSampleRate);
		}