KSPROPERTY_RTAUDIO_GETREADPACKET

KSPROPERTY_RTAUDIO_GETREADPACKET returns information about captured audio packets.

Usage Summary Table

Get Set Target Property descriptor type Property value type
Yes No Pin KSPROPERTY KSRTAUDIO_GETREADPACKET_INFO

The property descriptor (instance data) is a KSPROPERTY structure. Before sending the request, the client loads the structure with values that indicate the packet number, packet length and other information.

The property value is a variable of type KSRTAUDIO_GETREADPACKET_INFO.

Return Value

A KSPROPERTY_RTAUDIO_GETREADPACKET property request returns STATUS_SUCCESS to indicate that it has completed successfully. Otherwise, the request returns an appropriate failure status code.

STATUS_DEVICE_NOT_READY - The driver returns this error if no new data is available.

Remarks

Before reading captured audio data from the WaveRT buffer, the OS calls this routine to get information about the available data.

The packet number identifies a packet within the stream. This resets to zero when the stream is in KSSTATE_STOP. The number advances with each captured buffer. From the packet number the OS can derive the packet location within the WaveRT buffer and can also derive the stream position of the packet relative to start of stream.

The packet size is the WaveRT buffer size divided by the NotificationCount passed to KSPROPERTY_RTAUDIO_BUFFER_WITH_NOTIFICATION. The OS may call this routine at any time. In normal operation, the OS calls this routine after the driver sets the buffer notification event or after a previous call returns true for MoreData. When the OS calls this routine, the driver may assume that the OS has finished reading all previous packets. If the hardware has captured enough data, the driver may immediately burst the next complete packet to the WaveRT buffer and set the buffer event again. In the case of capture overflow (when the OS does not read data quickly enough) the audio driver may drop or overwrite some audio data. The audio driver drops or overwrites oldest data first, The audio driver may continue to advance its internal packet counter even though the OS may not have read the data.

Requirements

Version

Available in Windows 10 and later Windows operating systems.

Header

Ksmedia.h

See also

KSPROPERTY_RTAUDIO_SETWRITEPACKET

UsePositionLock