IAudioSessionControl::GetLastActivation method

The GetLastActivation method retrieves the time that the audio session last changed to the active state.

Syntax


HRESULT GetLastActivation(
  [out]  DATE *pRetVal
);

Parameters

pRetVal [out]

Pointer to a caller-allocated DATE variable into which the method writes the time of the last activation. The time is expressed in Universal Coordinated Time (UTC) format. For more information about DATE and UTC, see the Windows SDK documentation.

Return value

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 codeDescription
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

An audio session is active if it contains one or more active audio streams. An active stream is in the running state. An inactive stream is in the stopped state. A session becomes active when its first stream becomes active. A session becomes inactive when its last active stream becomes inactive. 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 client assigns a stream to a session when it calls the IAudioClient::Initialize method to create the stream.

The client can determine the time at which the session last became inactive by calling the IAudioSessionControl::GetLastInactivation method. The client can determine whether the session is currently active or inactive by calling the IAudioSessionControl::GetState method.

Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Audiopolicy.h

See also

IAudioClient::Initialize
IAudioSessionControl Interface
IAudioSessionControl::GetState

 

 

Send comments about this topic to Microsoft

Build date: 10/12/2013

Community Additions

Show:
© 2014 Microsoft