def feat_extraction(in_wav_dir, file_name_token, out_feats_dir):

    # Display:
    print("\nAnalysing file: " + file_name_token +
          '.wav............................')

    # File setup:
    wav_file = os.path.join(in_wav_dir, file_name_token + '.wav')
    mp.analysis_for_acoustic_modelling(wav_file, out_feats_dir)
    return
def feat_extraction(wav_file, out_feats_dir):

    # Parsing path:
    file_name_token = os.path.basename(os.path.splitext(wav_file)[0])

    # Display:
    print("\nAnalysing file: " + file_name_token + '.wav' + '................................')

    mp.analysis_for_acoustic_modelling(wav_file, out_feats_dir)
    return
Esempio n. 3
0
def feat_extraction(in_wav_dir, file_name_token, out_feats_dir, d_opts):

    # Display:
    print("\nAnalysing file: " + file_name_token + '.wav............................')

    # File setup:
    wav_file = join(in_wav_dir, file_name_token + '.wav')

    mp.analysis_for_acoustic_modelling(wav_file, out_feats_dir,
                                        mag_dim=d_opts['mag_dim'],
                                        phase_dim=d_opts['phase_dim'],
                                        b_const_rate=d_opts['b_const_rate'])
    return
Esempio n. 4
0
def feat_extraction(in_wav_dir, file_name_token, out_feats_dir, d_opts):

    # Display:
    print("\nAnalysing file: " + file_name_token + '.wav............................')

    # File setup:
    wav_file = join(in_wav_dir, file_name_token + '.wav')

    mp.analysis_for_acoustic_modelling(wav_file, out_feats_dir,
                                        mag_dim=d_opts['mag_dim'],
                                        phase_dim=d_opts['phase_dim'],
                                        b_const_rate=d_opts['b_const_rate'])
    return
    def feat_extraction_magphase_one_file(in_wav_dir, file_name_token, acous_feats_dir, cfg, logger):

        # Logging:
        logger.info('Analysing waveform: %s.wav' % (file_name_token))

        # File setup:
        wav_file = os.path.join(in_wav_dir, file_name_token + '.wav')

        # Feat extraction:
        mp.analysis_for_acoustic_modelling(wav_file, out_dir=acous_feats_dir, mag_dim=cfg.mag_dim,
                                                            phase_dim=cfg.real_dim, b_const_rate=cfg.magphase_const_rate)

        return
Esempio n. 6
0
def extract(sentence, wavdir, outdir, const_rate):
    try:
        mp.analysis_for_acoustic_modelling(path.join(wavdir,
                                                     sentence + '.wav'),
                                           outdir,
                                           mag_dim=cfg_data.get('nm', 60),
                                           phase_dim=cfg_data.get('np', 45),
                                           b_const_rate=const_rate)
    except (KeyboardInterrupt, SystemExit):
        raise
    except:
        print2('Error while extracting features from',
               path.join(wavdir, sentence + '.wav'), 'to', outdir)
        flush2()
    else:
        print1(sentence)
        flush1()
Esempio n. 7
0
    def feat_extraction_magphase_one_file(in_wav_dir, file_name_token,
                                          acous_feats_dir, cfg, logger):

        # Logging:
        logger.info('Analysing waveform: %s.wav' % (file_name_token))

        # File setup:
        wav_file = os.path.join(in_wav_dir, file_name_token + '.wav')

        # Feat extraction:
        mp.analysis_for_acoustic_modelling(
            wav_file,
            out_dir=acous_feats_dir,
            mag_dim=cfg.mag_dim,
            phase_dim=cfg.real_dim,
            b_const_rate=cfg.magphase_const_rate)

        return