How can I correct the queue in dsp.AudioRecorder?

1 view (last 30 days)
I am trying to create a plot of a series of sound signals (to ensure that the signal received by my subjects is the correct one)register through a microphone. I have the simple set up using dsp.Audio Recorder, but every time I run it I get a Warning that says that the queue has been overrun. Also, in the plot that registers the sound the x axis is is kHz, when I need Hz.
Can you help me to modify these two little things?
This is the code:
%% Microphone analisys SamplesPerFrame = 512; Microphone = dsp.AudioRecorder('QueueDuration',0.2,'DeviceName','Built-in Microph','SamplesPerFrame',SamplesPerFrame,... 'NumChannels',1,'OutputDataType','double'); Fs = Microphone.SampleRate;
Spectra = dsp.SpectrumAnalyzer('RBWSource','Property','SampleRate',Fs,'TwoSidedSpectrum',false,... 'SpectralAverages',20,'FrequencyScale','Log');
%% Stream tic; while toc < 10 % Read frame from microphone audioIn = step(Microphone);
% View audio spectrum step(Spectra,audioIn); end
%% Terminate release(Microphone) s = []; release(Spectra) s.Spectra = Spectra;
And this is the warning that comes up: Warning: The queue has overrun by 48013 samples. Try increasing queue duration, buffer size, or throughput rate.
Thank you.

Answers (0)

Community Treasure Hunt

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

Start Hunting!