gvSetFilter

GameSpy SDK

gvSetFilter

Sets a device's filter callback.

void gvSetFilter(
GVDevice device,
GVDeviceType type,
gvFilterCallback callback );
RoutineRequired HeaderDistribution
gvSetFilter<gv.h>SDKZIP

Parameters

device
[in] The handle to the device.
type
[in] Set the filter on capture, playback, or both.
callback
[in] The filter callback to use.

Remarks

Filtering allows you to process, or just monitor, audio that has ben captured or is being played. A filter callback, prototyped as the gvFilterCallback type, is passed the device the filtering is happening on, the audio to filter, and the audio’s frame stamp. The audio will always be a single raw frame of audio. Use gvGetCodecInfo to get the number of samples in a raw frame.

The callback can modify the audio in any way that it wants. However once the function returns it can no longer access the audio. For capture devices, audio will only be passed to the filter if it crosses the threshold (if one is set). For playback devices, audio is filtered after all of the sources have been mixed.

You can use gvSetFilter to set a filter on any device, and to set it for capture or playback. A device can have only one capture filter at a time and only one playback filter at a time. To clear a filter, call this function with the callback set to NULL.

Section Reference: Gamespy Voice SDK

See Also: gvFilterCallback