共用方式為


Headset 類別

定義

包含附加至遊戲台的音訊頭戴式裝置相關資訊。

public ref class Headset sealed
public ref class Headset sealed : IGameControllerBatteryInfo
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Headset final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Headset final : IGameControllerBatteryInfo
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Headset
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Headset : IGameControllerBatteryInfo
Public NotInheritable Class Headset
Public NotInheritable Class Headset
Implements IGameControllerBatteryInfo
繼承
Object Platform::Object IInspectable Headset
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

無法直接建立 Headset 類別的實例;而是透過 Gamepad.Headset 屬性或Gamepad.HeadsetConnected事件來擷取Headset類別的實例。

版本歷程記錄

Windows 版本 SDK 版本 新增值
1703 15063 TryGetBatteryReport

屬性

CaptureDeviceId

頭戴式裝置音訊擷取裝置的 XAudio 端點識別碼。

RenderDeviceId

頭戴式裝置音訊轉譯裝置的 XAudio 列舉識別碼。

方法

TryGetBatteryReport()

取得頭戴式裝置目前電池狀態的相關資訊。

適用於