how to remove the data (output of the function 'getaudiodata') from the memory buffer when I record an audio for long time and plot it at the same time?

8 次查看(过去 30 天)
I record an audio signal from microphone and I plot it in real time. Simply I have:
rObj=audiorecorder(fs, 24, 2);
recordblocking(rObj)
y=getaudiodata(rObj);
data accumulates in samples so it can not do recording for long time. Is it possible to remove data from the memory sometimes?

回答(1 个)

Walter Roberson
Walter Roberson 2018-6-13
No, it is not.
If you do not need to keep all of the data until the end, and the amount of data is not easily handled, then you should not be using audiorecorder: you should be using the Audio System Toolbox, probably with audioDeviceReader()
  23 个评论
Walter Roberson
Walter Roberson 2018-7-21
That BufferSize is too small, should be at least as large as SamplesPerFrame.
You should probably be telling animatedline to limit the number of points it displays.
hoda kazemzadeh
hoda kazemzadeh 2018-7-23
I am trying to modify my code in GUI. I dont use audiotimer function now. In 'OutputFcn' I write the dsp.audiorecorder and step functions and display the signal. I get this error when it reaches the line of 'step' function :
A given audio device may only be opened once.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by