Пример #1
0
def praat_syllable_nuclei(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".wav")

    praat = audio.PraatRunner("praat_syllable_nuclei", out_dir=out_folder)
    p = ProgressPipeline(file_finder | praat, n_threads=num_threads, quiet=True)

    return p
Пример #2
0
def lex(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".txt")

    feats = lexicosyntactic.Lexicosyntactic("lexicosyntactic", out_dir=out_folder, cfg_file="default.conf")

    p = ProgressPipeline(file_finder | feats, n_threads=num_threads, quiet=True)

    return p
Пример #3
0
def kaldi_asr(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".wav")
    resample = audio.ResampleWav("resampled_audio", out_dir=out_folder, new_sr=8000)
    asr = audio.KaldiASR("kaldi_asr", out_dir=out_folder)


    p = ProgressPipeline(file_finder | resample | asr, n_threads=num_threads, quiet=True)

    return p
Пример #4
0
def split_speech_eaf(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".wav")

    splitter = EafSegments(in_folder)
    split = audio.SplitSegments("split_speech", out_dir=out_folder, segment_mapping_fn=splitter.get_segs_for_file)

    p = ProgressPipeline(file_finder | split, n_threads=num_threads, quiet=True)

    return p
Пример #5
0
def opensmile_is10(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".wav")

    is10 = audio.OpenSmileRunner("is10", out_dir=out_folder, conf_file="IS10_paraling.conf", out_flag="-csvoutput")


    p = ProgressPipeline(file_finder | is10, n_threads=num_threads, quiet=True)

    return p
Пример #6
0
def matlab(in_folder, out_folder, num_threads):
    from nodes import matlab as mtlb

    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".wav")

    is10 = mtlb.MatlabRunner("matlab_acoustics", out_dir=out_folder, function="extract_acoustics", out_ext=".txt")

    p = ProgressPipeline(file_finder | is10, n_threads=num_threads, quiet=True)

    return p
Пример #7
0
def lex_chinese(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".txt")

    feats = lexicosyntactic_multi.ChineseLex("lex_chinese", out_dir=out_folder)

    p = ProgressPipeline(file_finder | feats,
                         n_threads=num_threads,
                         quiet=True,
                         exec_name="ParallelExecutor2")

    return p
Пример #8
0
def main(in_folder, out_folder, num_threads):
    file_finder = helper.FindFiles("file_finder", dir=in_folder, ext=".wav")

    resample = audio.ResampleWav("resampled_audio",
                                 out_dir=out_folder,
                                 new_sr=8000)

    is10_lld = audio.OpenSmileRunner("is10_lld",
                                     out_dir=out_folder,
                                     conf_file="IS10_paraling.conf",
                                     out_flag="-lldcsvoutput")
    is10 = audio.OpenSmileRunner("is10",
                                 out_dir=out_folder,
                                 conf_file="IS10_paraling.conf",
                                 out_flag="-csvoutput")

    splitter = EafSegments(in_folder)
    split = audio.SplitSegments("utterances",
                                out_dir=out_folder,
                                segment_mapping_fn=splitter.get_segs_for_file,
                                out_streams=["audio", "label"])

    is10_lld_per_utterance = audio.OpenSmileRunner(
        "is10_lld_per_utterance",
        out_dir=out_folder,
        in_streams="audio",
        conf_file="IS10_paraling.conf",
        out_flag="-lldcsvoutput")
    is10_per_utterance = audio.OpenSmileRunner("is10_per_utterance",
                                               out_dir=out_folder,
                                               in_streams="audio",
                                               conf_file="IS10_paraling.conf",
                                               out_flag="-csvoutput")

    asr = audio.KaldiASR("kaldi_asr", out_dir=out_folder, in_streams="audio")

    p = ProgressPipeline(file_finder | resample | [
        is10_lld, is10,
        split | [asr, is10_lld_per_utterance, is10_per_utterance]
    ],
                         n_threads=num_threads,
                         quiet=True)

    return p