Undefined function 'preprocessAudio' for input arguments of type 'single'
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 AI for Signals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!