Skip to content

Latest commit

 

History

History
131 lines (102 loc) · 4.87 KB

nf-audiopolicy-iaudiosessioncontrol-getstate.md

File metadata and controls

131 lines (102 loc) · 4.87 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:audiopolicy.IAudioSessionControl.GetState
IAudioSessionControl::GetState (audiopolicy.h)
The GetState method retrieves the current state of the audio session.
GetState
GetState method [Core Audio]
GetState method [Core Audio]
IAudioSessionControl interface
IAudioSessionControl interface [Core Audio]
GetState method
IAudioSessionControl.GetState
IAudioSessionControl::GetState
IAudioSessionControlGetState
audiopolicy/IAudioSessionControl::GetState
coreaudio.iaudiosessioncontrol_getstate
coreaudio\iaudiosessioncontrol_getstate.htm
CoreAudio
9c0188a1-7982-40f0-9040-bda00473160c
12/05/2018
GetState, GetState method [Core Audio], GetState method [Core Audio],IAudioSessionControl interface, IAudioSessionControl interface [Core Audio],GetState method, IAudioSessionControl.GetState, IAudioSessionControl::GetState, IAudioSessionControlGetState, audiopolicy/IAudioSessionControl::GetState, coreaudio.iaudiosessioncontrol_getstate
audiopolicy.h
Windows
Windows Vista [desktop apps \| UWP apps]
Windows Server 2008 [desktop apps \| UWP apps]
Windows
19H1
IAudioSessionControl::GetState
audiopolicy/IAudioSessionControl::GetState
c++
APIRef
kbSyntax
COM
Audiopolicy.h
IAudioSessionControl.GetState

IAudioSessionControl::GetState

-description

The GetState method retrieves the current state of the audio session.

-parameters

-param pRetVal [out]

Pointer to a variable into which the method writes the current session state. The state must be one of the following AudioSessionState enumeration values:

AudioSessionStateActive

AudioSessionStateInactive

AudioSessionStateExpired

These values indicate that the session state is active, inactive, or expired, respectively. For more information, see Remarks.

-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
E_POINTER
Parameter pRetVal is NULL.
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.

-remarks

This method indicates whether the state of the session is active, inactive, or expired. The state is active if the session has one or more streams that are running. The state changes from active to inactive when the last running stream in the session stops. The session state changes to expired when the client destroys the last stream in the session by releasing all references to the stream object.

The Sndvol program displays volume and mute controls for sessions that are in the active and inactive states. When a session expires, Sndvol stops displaying the controls for that session. If a session has previously expired, but the session state changes to active (because a stream in the session begins running) or inactive (because a client assigns a new stream to the session), Sndvol resumes displaying the controls for the session.

The client creates a stream by calling the IAudioClient::Initialize method. At the time that it creates a stream, the client assigns the stream to a session. A session begins when a client assigns the first stream to the session. Initially, the session is in the inactive state. The session state changes to active when the first stream in the session begins running. The session terminates when a client releases the final reference to the last remaining stream object in the session.

-see-also

IAudioClient::Initialize

IAudioSessionControl Interface

IMMDevice::Activate