Error meassge while using wavread and audioread
显示 更早的评论
This is a code for computing mfcc.I'm getting error as
'Undefined function 'wavread' for input arguments of type 'char'.'
When audioread is used instead of wavread it is shown that 'Too many output arguments.'
Could anybody help me resolving the issue?
% Define variables
Tw = 25; % analysis frame duration (ms)
Ts = 10; % analysis frame shift (ms)
alpha = 0.97; % preemphasis coefficient
M = 20; % number of filterbank channels
C = 12; % number of cepstral coefficients
L = 22; % cepstral sine lifter parameter
LF = 300; % lower frequency limit (Hz)
HF = 3700; % upper frequency limit (Hz)
wav_file = 'sp10.wav'; % input audio filename
N = 9;
P = 7;
file_name_array = {'a','d','f','h','n','sa','su'};
for i=1:N
for k=1:P
wav_file = char(strcat(dir_path,file_name_array(k),'0',num2str(i)));
% for i=1:
% Read speech samples, sampling rate and precision from file
[ speech, fs, nbits ] = wavread( wav_file );
% Feature extraction (feature vectors as columns)
[ MFCCs, FBEs, frames ] = ...
mfcc( speech, fs, Tw, Ts, alpha, @hamming, [LF HF], M, C+1, L );
回答(1 个)
KSSV
2021-8-17
Try treplacing this line:
wav_file = char(strcat(dir_path,file_name_array(k),'0',num2str(i)));
with
wav_file = [dir_path,filesep,file_name_array(k),'0',num2str(i)];
Also read about fullfile.
类别
在 帮助中心 和 File Exchange 中查找有关 Cepstral Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!