AudioInput QML Type

用于在捕获会话中捕获音频的音频输入。更多

Import Statement: import QtMultimedia
In C++: QAudioInput

属性

详细说明

CaptureSession {
    id: playMusic
    audioInput: AudioInput {
        volume: slider.value
    }
    recorder: MediaRecorder { ... }
}
Slider {
    id: slider
    from: 0.
    to: 1.
}

您可以将 AudioInput 与 QtMultiMedia::CaptureSession 结合使用,从音频输入设备捕获音频。

另请参阅 CameraAudioOutput

属性文档

device : AudioDevice

此属性描述了连接到此输入的音频设备。

设备属性表示此输入所连接的音频设备。此属性可用于从 QtMultimedia::MediaDevices::audioInputs() 列表中选择输出设备。


muted : bool

该属性表示音频输入是否静音。

默认值为false


volume : real

音量按线性比例缩放,范围从0 (静音)到1 (全音量)。

注意: 超出此范围的值将被箝位。

默认音量为1

用户界面音量控制通常应以非线性方式缩放。例如,使用对数刻度会使感知响度产生线性变化,而这正是用户通常期望从音量控制中获得的效果。

另请参见 QtAudio::convertVolume()。


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