audioDevice QML Value Type

描述音频设备。更多

Import Statement: import QtMultimedia

属性

详细说明

audioDevice 值类型描述了连接到系统的音频设备的属性。

audioDevice 实例在其整个生命周期内都会保留其属性,即使相应的物理设备断开连接或其设置被修改。要跟踪更新的属性,用户应在相关信号触发时从MediaDevices 加载新的 audioDevice 实例。

音频输入或输出设备列表可通过MediaDevices 类型查询。要选择某个音频设备作为输入或输出设备,请将其设置为AudioInputAudioOutput 上的设备。

MediaPlayer {
    audioOutput: AudioOutput {
        device: mediaDevices.defaultAudioOutput
    }
}
MediaDevices {
    id: mediaDevices
}

属性文档

description : string

音频设备的可读名称。

使用此字符串向用户显示设备。


id : string

音频设备的标识符。

设备名称因所使用的平台/音频插件而异。

它们是音频设备的唯一标识符。


isDefault : bool

如果是默认音频设备,则为 true。


mode : enumeration

显示该设备是输入还是输出设备。

返回值可以是以下值之一:

常量说明
audioDevice.Null空设备。
audioDevice.Input输入设备。
audioDevice.Output输出设备。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.