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.

回答 (1 件)

Merry Dai
Merry Dai 2018 年 5 月 14 日

0 投票

the problem that I meet is below

カテゴリ

ヘルプ センター および File ExchangeApplications についてさらに検索

製品

質問済み:

2017 年 10 月 9 日

回答済み:

2018 年 5 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by