Undefined function 'preprocessAudio' for input arguments of type 'single'
Show older comments
Dear all Coding Experts in Matlab.
I am trying to Train Generative Adversarial Network (GAN) for Sound Synthesis.
But while operating perfor i am getting following error.
for the parfor-loop that is trying to execute on the worker could not be found.
Caused by:
Undefined function 'preprocessAudio' for input arguments of type 'single'.
Error using remoteParallelFunction
Worker unable to find file.
Undefined function 'preprocessAudio' for input arguments of type 'single'.
What Am i Doing Wrong ? I am implementing the code as it is.
Here is my code
downloadFolder = 'audio_folder';% Some folder that contains 100 audio files type .wav
percussivesoundsFolder = fullfile(downloadFolder);
ads = audioDatastore(percussivesoundsFolder,IncludeSubfolders=true);
fftLength = 256;
win = hann(fftLength,"periodic");
overlapLength = 128;
if canUseParallelPool
pool = gcp;
numPar = numpartitions(ads,pool);
else
numPar = 1;
end
parfor ii = 1:numPar
subds = partition(ads,numPar,ii);
STrain = zeros(fftLength/2+1,128,1,numel(subds.Files));
for idx = 1:numel(subds.Files)
% Read audio
[x,xinfo] = read(subds);
% Preprocess
x = preprocessAudio(single(x),xinfo.SampleRate);
% STFT
S0 = stft(x,Window=win,OverlapLength=overlapLength,FrequencyRange="onesided");
% Magnitude
S = abs(S0);
STrain(:,:,:,idx) = S;
end
Please help. Thank you in Advance.
Accepted Answer
More Answers (0)
Categories
Find more on AI for Signals in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!