#                np.var(map(lambda x: (mel[x,i] - moy[j]) / np.sqrt(var[j]), times))
            
            features["moy_loc_%s" %j] =\
                np.mean(map(lambda x: (mel[x,i] - mel_min) / (mel_max - mel_min), times))
            features["var_loc_%s" %j] =\
                np.var(map(lambda x: (mel[x,i] - mel_min) / (mel_max - mel_min), times))               
        
        try:
            text += words[2]+'\t'+str(features)+'\n'
        except BaseException, e:
            print e
    
    return text
    
f = open('transcript_test', 'Ur')
text = f.read()
turns = text.split('\n.\n')
turn = turns[1]
turn_formated = turn.split('\n')[1:]
dump = read_turn(mel, moy, var, turn_formated)

#%% Fourth step : read a file

def normalize_signal(path1, path2):
    """attention, retourne directement le tableau du signal."""
    f = Sndfile(path1)
    
    n = int(f.nframes)
    fs = f.samplerate 
    nc = f.channels # checker que c'est bien 1
    if nc != 1: