オーディオデータの逐次処理はどのように行いますか?
4 views (last 30 days)
Show older comments
MathWorks Support Team
on 1 May 2023
Answered: MathWorks Support Team
on 1 May 2023
「audiorecorder」オブジェクトと「record」関数を使用してオーディオデータを取得し、逐次 FFT や各種フィルタリング等の信号処理を行います。timer オブジェクトによるイベントとコールバックを使用しているのですが、各チャンクを計測するための時間より信号処理にかかる時間のほうが長い(計測より信号処理のほうが遅い)ため、時間の経過とともに「getaudiodata」を読み出したりコールバックを使用したりする際に処理するデータ量が増加し、やがて次のコールバックがトリガされる時間よりも長くなります。
Accepted Answer
MathWorks Support Team
on 1 May 2023
「audiorecorder」と「getaudiodata」は、オーディオのバッチ処理用に最適化されています。リアルタイムでのオーディオ処理の場合、推奨されるワークフローは、Audio Toolbox のリアルタイム オーディオ I/O オブジェクト「audioDeviceReader」および「audioDeviceWriter」を使用することです。詳細については、
https://www.mathworks.com/help/releases/R2019b/audio/gs/real-time-audio-in-matlab.html
をご参考ください。音圧測定のサンプルにてこれらのオブジェクトの使用方法が示されています。
https://www.mathworks.com/help/releases/R2019b/audio/examples/sound-pressure-measurement-of-octave-frequency-bands.html
0 Comments
More Answers (0)
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!