Continuous Audio Buffer in MATLAB?

1 回表示 (過去 30 日間)
Leon Müller
Leon Müller 2018 年 5 月 6 日
回答済み: Gael Goron 2018 年 5 月 15 日
Hello MATLAB-Community,
I'm somewhat new to MATLAB and its environment. For a bigger project I need to be able to construct a continuous Audio-Buffer of a certain size, that will automatically "overwrite" itself once it has run full. The Buffer should receive input from a microphone and record the entire time while the program is running. Afterwards I want to be able to do some computing with the output from the Buffer. Is there some convenient way of doing this? I found that the audioDeviceReader- and the dsp.AudioPlayer-objects should be useable for this operation, but I haven't figured out how.
Any help is appreciated.

回答 (1 件)

Gael Goron
Gael Goron 2018 年 5 月 15 日
Hello,
You are on the right track, yes you can use the audioDeviceReader System object. If you look on the online documentation, you will also see some example code to acquire buffered audio from a microphone: audio device reader
Note that after the line of code:
acquiredAudio = deviceReader();
Instead of writing the data to a file, you can also do some computing. Note that the 'SamplesPerFrame' property of the audioDeviceReader object is your audio buffer size.
Another example that shows how to use this function to compute the frequency response is available here .

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by