Can run from external directory. Outputs CSV. Works with TextGrids.

This commit is contained in:
Joseph Keshet
2016-06-29 21:20:34 -04:00
parent 4fb9cb39d5
commit 5940e013c5
7 changed files with 693 additions and 21 deletions
+16
View File
@@ -277,3 +277,19 @@ def create_features(input_wav_filename, feature_filename, begin=None, end=None,
np.savetxt(feature_filename, np.asarray(arcep_mat), delimiter=",", fmt="%s")
return arcep_mat
if __name__ == "__main__":
# parse arguments
parser = argparse.ArgumentParser(description='Extract features for formants estimation.')
parser.add_argument('wav_file', default='', help="WAV audio filename (single vowel or an whole utternace)")
parser.add_argument('feature_file', default='', help="output feature text file")
parser.add_argument('--begin', help="beginning time in the WAV file", default=0.0, type=float)
parser.add_argument('--end', help="end time in the WAV file", default=-1.0, type=float)
args = parser.parse_args()
if args.begin > 0.0 or args.end > 0.0:
create_features(args.wav_file, args.feature_file, args.begin, args.end)
else:
create_features(args.wav_file, args.feature_file)