def get_num_examples(self, wavlists, labellists, num_examples, num_features):
for n,(w, l) in enumerate(zip(wavlists, labellists)):
fs, au = wav.read(w)
# Extract Spectrum of audio inputs
melf = mfcc(au, samplerate = fs, numcep = self.num_features, winlen=0.025, winstep=0.01, nfilt=self.num_features)
#melf = (melf - np.mean(melf))/np.std(melf)
self.mel_freq.append(melf)
melf_target = self.labelprocessing(l)
self.target_label.append(melf_target)
if n == num_examples - 1:
break
if melf.shape[0] <= len(melf_target):
t = w,l
self.length_check.append(t)
# Split transcript into each label
评论列表
文章目录