本页内容

音频源示例

使用QAudioSource 类录制音频。

“音频源”演示了QAudioSource 的基本用例。

显示实时音频波形和控制按钮的用户界面

Qt 提供了 `QAudioSource ` 类,以便在标准应用程序用户界面中实现音频功能。

本示例计算来自麦克风的输入音频的最大线性值,并显示输出结果。该用户界面允许用户选择音频输入设备、暂停和恢复音频流、在不同的操作模式之间切换、调节音量以及更改音频格式参数。

运行示例

您可以通过以下方式运行此示例:

示例项目 @ code.qt.io

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