def process_audio(self, isTraining, sound_file):
""" Takes in a wav file and outputs labeled observations of the audio
isTraining: bool that is true if the model is being trained
"""
(rate, sig) = wav.read(sound_file)
sig = sig.astype(np.float64)
# MFCC Features. Each row corresponds to MFCC for a frame
mfcc_feat = mfcc(sig, rate)
labeled_obs = vq(mfcc_feat, self.codebook)[0]
self.voice_obs = labeled_obs
评论列表
文章目录