本页内容

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 配合使用,从音频输入设备捕获音频。

另请参阅 Camera 和AudioOutput 。

属性文档

device : AudioDevice

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

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

muted : bool

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

默认值为false 。

volume : real

音量按线性比例调节,范围从0 (静音)到1 (最大音量)。

注意: 超出此范围的数值 将被限制。

默认情况下,音量为1 。

UI 音量控件通常应采用非线性缩放。例如,使用对数刻度会产生感知响度的线性变化,这正是用户通常对音量控件的期望。

另请参阅 QtAudio::convertVolume()。

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