From 5775274a42ca99c866ee61f10a740c7f0129465c Mon Sep 17 00:00:00 2001 From: Joseph Keshet Date: Mon, 4 Jul 2016 12:23:25 +0300 Subject: [PATCH] Add conversion to 1 channel 16kHz --- extract_features.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extract_features.py b/extract_features.py index c824e9a..5161330 100644 --- a/extract_features.py +++ b/extract_features.py @@ -13,6 +13,7 @@ from copy import deepcopy from scipy.fftpack import fft, ifft from scikits.talkbox.linpred import lpc import shutil +from helpers.utilities import * epsilon = 0.0000000001 prefac = .97 @@ -263,7 +264,9 @@ def build_single_feature_row(data, Atal): def create_features(input_wav_filename, feature_filename, begin=None, end=None, Atal=False): - X = build_data(input_wav_filename, begin, end) + tmp_wav16_filename = generate_tmp_filename("wav") + easy_call("sox " + input_wav_filename + " -c 1 -r 16000 " + tmp_wav16_filename) + X = build_data(tmp_wav16_filename, begin, end) if begin is not None and end is not None: arr = [input_wav_filename] arr.extend(build_single_feature_row(X, Atal))