オーディオソースの例
QAudioSource クラスを使用した音声の録音。
「Audio Source」は、QAudioSource の基本的な使用例を示しています。

Qt は、標準的なアプリケーションのユーザーインターフェース内でオーディオ機能を利用できるようにするため、QAudioSource クラスを提供しています。
この例では、マイクからの入力オーディオの最大線形値を計算し、その結果を表示します。この UI を使用すると、ユーザーはオーディオ入力デバイスの選択、オーディオストリームの停止および再開、動作モードの切り替え、音量の調整、オーディオ形式のパラメータの変更を行うことができます。
例の動作
このサンプルは、以下の手順で実行できます。
- Qt Creator
Welcome モードを開き、Examples からこの例を選択します。詳細については、Qt Creator の「チュートリアル: ビルドと実行」を参照してください。
- Qt Extension for Visual Studio Code
Command Palette から `Qt: Open Qt examples ` コマンドを実行し、リストからこのサンプルを選択します。詳細については、Qt Extension for Visual Studio Code: Tutorial: Build and run を参照してください。
© 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.