IAudioSessionNotification::OnSessionCreated 方法 (audiopolicy.h)

OnSessionCreated 方法會通知已註冊的進程已建立音訊會話。

語法

HRESULT OnSessionCreated(
  [in] IAudioSessionControl *NewSession
);

參數

[in] NewSession

所建立音訊會話之 IAudioSessionControl 介面的指標。

傳回值

如果方法成功,它會傳回 S_OK。

備註

註冊其 IAudioSessionNotification 介面之後,應用程式會透過 介面的方法,以回呼的形式接收事件通知。

音訊引擎會在裝置端點上啟動新的會話時呼叫 OnSessionCreated 。 這個方法是從會話管理員線程呼叫。 如果這個方法想要在呼叫完成之後保留參考,這個方法就必須在 NewSession 參數中取得會話的參考。

規格需求

需求
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
目標平台 Windows
標頭 audiopolicy.h

另請參閱

IAudioSessionNotification