本页内容

audioDevice QML Value Type

描述一个音频设备。更多...

Import Statement: import QtMultimedia

属性

详细说明

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

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

可通过MediaDevices 类型查询音频输入或输出设备的列表。若要选择特定的音频设备作为输入或输出设备,请在AudioInput 或AudioOutput 中将其设置为目标设备。

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

属性文档

description : string

包含音频设备的可读名称。

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

id : string

存储音频设备的标识符。

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

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

isDefault : bool

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

mode : enumeration

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

返回值可以是以下之一:

常量描述
AudioDevice.Null空设备。
AudioDevice.Input输入设备。
AudioDevice.Output一个输出设备。

© 2026 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.