IAudioEndpointVolume::GetMasterVolumeLevel 方法 (endpointvolume.h)

GetMasterVolumeLevel 方法會取得進入或離開音訊端點裝置之音訊數據流的主要音量層級,以分貝為單位。

語法

HRESULT GetMasterVolumeLevel(
  [out] float *pfLevelDB
);

參數

[out] pfLevelDB

主要磁碟區層級的指標。 此參數指向 浮點 數變數,方法會將磁碟區層級寫入小數點。 若要取得從此方法取得的磁碟區層級範圍,請呼叫 IAudioEndpointVolume::GetVolumeRange 方法。

傳回值

如果方法成功,它會傳回 S_OK。 如果失敗,可能的傳回碼包括,但不限於下表所示的值。

傳回碼 Description
E_POINTER
參數 pfLevelDBNULL

規格需求

需求
最低支援的用戶端 Windows Vista [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2008 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 endpointvolume.h

另請參閱

IAudioEndpointVolume 介面

IAudioEndpointVolume::GetVolumeRange