このページでは

オーディオソースの例

QAudioSource クラスを使用した音声の録音。

「Audio Source」は、QAudioSource の基本的な使用例を示しています。

リアルタイムのオーディオ波形とコントロールボタンを表示するUI

Qt は、標準的なアプリケーションのユーザーインターフェース内でオーディオ機能を利用できるようにするため、QAudioSource クラスを提供しています。

この例では、マイクからの入力オーディオの最大線形値を計算し、その結果を表示します。この UI を使用すると、ユーザーはオーディオ入力デバイスの選択、オーディオストリームの停止および再開、動作モードの切り替え、音量の調整、オーディオ形式のパラメータの変更を行うことができます。

例の動作

このサンプルは、以下の手順で実行できます。

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.