Exemplo n.º 1
0
def to_prosody(filename,time_step):
    p = PraatLoader()
    output = p.run_script('pitch.praat', filename,time_step)
    try:
        pitch = to_time_based_dict(output)
    except IndexError:
        return None
    output = p.run_script('intensity.praat', filename,time_step)
    intensity = to_time_based_dict(output)
    prosody = interpolate_prosody(pitch,intensity)
    return prosody
def to_prosody(filename, time_step):
    p = PraatLoader()
    output = p.run_script('pitch.praat', filename, time_step)
    try:
        pitch = to_time_based_dict(output)
    except IndexError:
        return None
    output = p.run_script('intensity.praat', filename, time_step)
    intensity = to_time_based_dict(output)
    prosody = interpolate_prosody(pitch, intensity)
    return prosody
def to_pitch(filename, time_step):
    p = PraatLoader()
    output = p.run_script('pitch.praat', filename, time_step)
    try:
        pitch = to_time_based_dict(output)
    except IndexError:
        return None
    pitch_spline = interpolate_pitch(pitch)
    if pitch_spline is None:
        return None
    return pitch_spline.T
Exemplo n.º 4
0
def to_pitch(filename,time_step):
    p = PraatLoader()
    output = p.run_script('pitch.praat', filename,time_step)
    try:
        pitch = to_time_based_dict(output)
    except IndexError:
        return None
    pitch_spline = interpolate_pitch(pitch)
    if pitch_spline is None:
        return None
    return pitch_spline.T
def to_mfcc_praat(filename, freq_lims, numCC,win_len,time_step):
    max_mel = freqToMel(freq_lims[1])
    scripts = {'mfcc.praat':"""
        form Variables
            sentence file
            positive numCC
            real windowLength
            real timeStep
            real maxMel
        endform

        Read from file... 'file$'

        To MFCC... numCC windowLength timeStep 100.0 100.0 maxMel

        To TableOfReal... 0
        
        output$ = ""
        
        numRows = Get number of rows
        
        for i from 1 to numRows
            for j from 1 to numCC
                val = Get value... i j
                val$ = fixed$(val,3)
                output$ = output$ + val$
                if j != numCC
                    output$ = output$ + tab$
                endif
            endfor
            if i != numRows
                output$ = output$ + newline$
            endif
        endfor

        echo 'output$'"""}
    p = PraatLoader(additional_scripts=scripts)
    output = p.run_script('mfcc.praat',filename,numCC,win_len,time_step,max_mel)
    return to_array(output)
def formant_tracks(filename, n, max_formant, praat = None):
    if not praat:
        praat = PraatLoader(debug=True)
    text = praat.run_script('formant_list.praat', filename, n, max_formant)
    return praat.read_praat_out(text)
def to_intensity(filename, time_step):
    p = PraatLoader()
    output = p.run_script('intensity.praat', filename, time_step)
    intensity = to_time_based_dict(output)
    intensity_spline = get_intensity_spline(intensity)
    return intensity_spline.T
Exemplo n.º 8
0
def to_intensity(filename,time_step):
    p = PraatLoader()
    output = p.run_script('intensity.praat', filename,time_step)
    intensity = to_time_based_dict(output)
    intensity_spline = get_intensity_spline(intensity)
    return intensity_spline.T