示例#1
0
    'graph_host': 'localhost',
    'graph_port': 7474,
    'graph_user': '******',
    'graph_password': '******'
}

praat = r'C:\Users\michael\Documents\Praat\praatcon.exe'

reaper = r'D:\Dev\Tools\REAPER-master\reaper.exe'

speaker_info_path = r'D:\Data\VIC\SpeakerInfo.txt'

config = CorpusConfig('buckeye', **graph_db)

config.reaper_path = reaper
config.praat_path = praat
config.pitch_algorithm = 'praat'


def call_back(*args):
    args = [x for x in args if isinstance(x, str)]
    if args:
        print(' '.join(args))


if __name__ == '__main__':
    with CorpusContext(config) as g:
        g.reset_acoustics()
        if not 'utterance' in g.annotation_types:
            g.encode_pauses('^[{<].*', call_back=call_back)
            g.encode_utterances(min_pause_length=0.15, call_back=call_back)
示例#2
0
        q = q.columns(c.phone.speaker.name.column_name('speaker'),
                      c.phone.discourse.name.column_name('discourse'),
                      c.phone.id.column_name('phone_id'),
                      c.phone.label.column_name('phone_label'),
                      c.phone.begin.column_name('begin'),
                      c.phone.end.column_name('end'),
                      c.phone.following.label.column_name('following_phone'),
                      c.phone.previous.label.column_name('previous_phone'),
                      c.phone.word.label.column_name('word'),
                      c.phone.cog.column_name('cog'),
                      c.phone.peak.column_name('peak'),
                      c.phone.slope.column_name('slope'),
                      c.phone.spread.column_name('spread'))
        q.to_csv(output_path_word_initial)
        print("Results for sibilants written to " + output_path + " and " +
              output_path_word_initial)


if __name__ == '__main__':
    with ensure_local_database_running('database') as config:
        conf = CorpusConfig(corpus_name, **config)
        conf.pitch_source = 'praat'
        # config.pitch_algorithm = 'base'
        conf.formant_source = 'praat'
        conf.intensity_source = 'praat'
        conf.praat_path = praat_path
        if reset:
            loading(conf)
        acoustics(conf)
        analysis(conf)