Programing/TIP5 [Programing] 깔끔한 코드 짜는 10가지 규칙 def get_librosa_mfcc(filepath, n_mfcc = 40, del_silence = False, input_reverse = True): if filepath.split('.')[-1] == 'pcm': pcm = np.memmap(filepath, dtype='h', mode='r') sig = np.array([float(x) for x in pcm]) elif filepath.split('.')[-1] == 'wav': sig, _ = librosa.core.load(filepath, sr=16000) else: raise ValueError("Invalid format !!") if del_silence: non_silence_ids = librosa.effects.split(.. 2021. 3. 5. 이전 1 2 다음