Esempio n. 1
0
def token_envelope_similarity(wt1, wt2):
    wt1_path = fetch_temp_resource('buckeye-wt-%d.wav' % wt1.pk)
    if not os.path.isfile(wt1_path):
        extract_vowel(wt1.get_dialog_path(),wt1.Begin,wt1.End,wt1_path)
    wt2_path = fetch_temp_resource('buckeye-wt-%d.wav' % wt2.pk)
    if not os.path.isfile(wt2_path):
        extract_vowel(wt2.get_dialog_path(),wt2.Begin,wt2.End,wt2_path)
    sim = envelope_similarity(wt1_path,wt2_path)
    return sim
Esempio n. 2
0
def token_to_env(wt):
    path = fetch_temp_resource('buckeye-wt-%d.wav' % wt.pk)
    if not os.path.isfile(path):
        extract_vowel(wt.get_dialog_path(),wt.Begin,wt.End,path)
    env = calc_envelope(path)
    return env