Skip to content

Latest commit

 

History

History
131 lines (101 loc) · 4.82 KB

nf-audioclient-iaudiocaptureclient-getnextpacketsize.md

File metadata and controls

131 lines (101 loc) · 4.82 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:audioclient.IAudioCaptureClient.GetNextPacketSize
IAudioCaptureClient::GetNextPacketSize (audioclient.h)
The GetNextPacketSize method retrieves the number of frames in the next data packet in the capture endpoint buffer.
GetNextPacketSize
GetNextPacketSize method [Core Audio]
GetNextPacketSize method [Core Audio]
IAudioCaptureClient interface
IAudioCaptureClient interface [Core Audio]
GetNextPacketSize method
IAudioCaptureClient.GetNextPacketSize
IAudioCaptureClient::GetNextPacketSize
IAudioCaptureClientGetNextPacketSize
audioclient/IAudioCaptureClient::GetNextPacketSize
coreaudio.iaudiocaptureclient_getnextpacketsize
coreaudio\iaudiocaptureclient_getnextpacketsize.htm
CoreAudio
352dcd7d-a7e1-493f-b9ce-c125f9d45fa8
12/05/2018
GetNextPacketSize, GetNextPacketSize method [Core Audio], GetNextPacketSize method [Core Audio],IAudioCaptureClient interface, IAudioCaptureClient interface [Core Audio],GetNextPacketSize method, IAudioCaptureClient.GetNextPacketSize, IAudioCaptureClient::GetNextPacketSize, IAudioCaptureClientGetNextPacketSize, audioclient/IAudioCaptureClient::GetNextPacketSize, coreaudio.iaudiocaptureclient_getnextpacketsize
audioclient.h
Windows
Windows Vista [desktop apps \| UWP apps]
Windows Server 2008 [desktop apps \| UWP apps]
Windows
19H1
IAudioCaptureClient::GetNextPacketSize
audioclient/IAudioCaptureClient::GetNextPacketSize
c++
APIRef
kbSyntax
COM
Audioclient.h
IAudioCaptureClient.GetNextPacketSize

IAudioCaptureClient::GetNextPacketSize

-description

The GetNextPacketSize method retrieves the number of frames in the next data packet in the capture endpoint buffer.

-parameters

-param pNumFramesInNextPacket [out]

Pointer to a UINT32 variable into which the method writes the frame count (the number of audio frames in the next capture packet).

-returns

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
AUDCLNT_E_DEVICE_INVALIDATED
The audio endpoint device has been unplugged, or the audio hardware or associated hardware resources have been reconfigured, disabled, removed, or otherwise made unavailable for use.
AUDCLNT_E_SERVICE_NOT_RUNNING
The Windows audio service is not running.
E_POINTER
Parameter pNumFramesInNextPacket is NULL.

-remarks

Use this method only with shared-mode streams. It does not work with exclusive-mode streams.

Before calling the IAudioCaptureClient::GetBuffer method to retrieve the next data packet, the client can call GetNextPacketSize to retrieve the number of audio frames in the next packet. The count reported by GetNextPacketSize matches the count retrieved in the GetBuffer call (through the pNumFramesToRead output parameter) that follows the GetNextPacketSize call.

A packet always consists of an integral number of audio frames.

GetNextPacketSize must be called in the same thread as the GetBuffer and IAudioCaptureClient::ReleaseBuffer method calls that get and release the packets in the capture endpoint buffer.

For a code example that uses the GetNextPacketSize method, see Capturing a Stream.

-see-also

IAudioCaptureClient Interface

IAudioCaptureClient::GetBuffer

IAudioCaptureClient::ReleaseBuffer

IAudioClient::GetCurrentPadding