필터 지우기
필터 지우기

Continuous Audio Buffer in MATLAB?

조회 수: 4 (최근 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 CenterFile Exchange에서 Audio 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