DSP: Development Test Bench example code indexing error

So I tried this example code:
frameLength = 256;
fileReader = dsp.AudioFileReader(...
'Counting-16-44p1-mono-15secs.wav',...
'SamplesPerFrame',frameLength);
deviceWriter = audioDeviceWriter(...
'SampleRate',fileReader.SampleRate);
scope = dsp.TimeScope(...
'SampleRate',fileReader.SampleRate,...
'TimeSpan',16,...
'BufferLength',1.5e6,...
'YLimits',[-1 1]);
dRG = noiseGate(...
'SampleRate',fileReader.SampleRate,...
'Threshold',-25,...
'AttackTime',10e-3,...
'ReleaseTime',20e-3,...
'HoldTime',0);
visualize(dRG);
configureMIDI(dRG);
while ~isDone(fileReader)
signal = fileReader();
noisySignal = signal + 0.0025*randn(frameLength,1);
processedSignal = dRG(noisySignal);
deviceWriter(processedSignal);
scope([noisySignal,processedSignal]);
end
release(fileReader);
release(deviceWriter);
release(scope);
release(dRG);
It gives me the following error:
Array formation and parentheses-style indexing with objects of class 'dsp.AudioFileReader' is not allowed. Use objects
of class 'dsp.AudioFileReader' only as scalars or use a cell array.
Error in workbench (line 30)
signal = fileReader();
I can't figure out how to solve it, please help.

Answers (1)

Categories

Products

Asked:

on 9 Oct 2017

Answered:

on 14 May 2018

Community Treasure Hunt

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

Start Hunting!