gvCapturePacket

GameSpy SDK

gvCapturePacket

Takes captured audio data out of the internal capture buffer, storing it in the provided packet memory block.

GVBool gvCapturePacket(
GVDevice device,
GVByte * packet,
int * len,
GVFrameStamp * frameStamp,
GVScalar * volume );
RoutineRequired HeaderDistribution
gvCapturePacket<gv.h>SDKZIP

Return Value

GVTrue if successful in getting a packet and encoding it into the provided memory block; GVFalse if either no audio data was available to capture or an error occurred while capturing the audio.

Parameters

device
[in] A handle to the capture device
packet
[in] A block of memory to receive the data
len
[ref] The maximum / number of bytes moved into the memory block specified by packet parameter.
frameStamp
[out] The frame stamp for the captured packet
volume
[out] The peak volume for the audio in the frame

Remarks

The packet parameter must be large enough to hold at least one encoded frame (gvGetCodecInfo can be used to get the size of an encoded frame). The function will fill this memory with as many encoded frames as it can.
The len parameter must point to an int which is set to the maximum number of bytes that can be written to the block of memory pointed to be the packet parameter. After the function returns, if it was successful, len will point to the number of bytes that were written to the block of memory.
The frameStamp parameter will receive the frame stamp for the captured packet, and the volume parameter, the peak volume for the audio in the frame. The volume ranges from 0.0 to 1.0, and it can be used to power a per-player graphic voice activity meter.