def get_valence(audio_path, audio_file, A, a): h = calc_h(audio_path + audio_file) g = calc_g(max(A), h, 20.0) r = calc_r(a, h) l = len(g) if len(r) < l: l = len(r) v = [] for i in range(l): v.append(r[i] + g[i]) valence = kaiser.convolve_kaiser_abs(150, 5, v) return valence
def calc_h(filename): p = pitch.get_audio_pitch_average(filename, 15, 10, 100) h = kaiser.convolve_kaiser_abs(70, 5, p) return h