Last active
May 4, 2023 06:50
-
-
Save weimeng23/dd409f5d003c5f3aac0deea6d699d267 to your computer and use it in GitHub Desktop.
kaldi command pipeline expression in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delta_command = "compute-mfcc-feats --config=conf/mfcc.conf scp,p:wav_test.scp ark:- | add-deltas ark:- ark:- |" | |
delta_feats_rspecifier = ( | |
f'ark:{delta_command}' | |
) | |
mfcc_command = "compute-mfcc-feats --config=conf/mfcc.conf scp,p:wav_test.scp ark:- |" | |
mfcc_feats_rspecifier = ( | |
f'ark:{mfcc_command}' | |
) | |
mfcc_pitch_command = "compute-kaldi-pitch-feats --config=conf/pitch.conf scp,p:wav_test.scp ark:- | process-kaldi-pitch-feats ark:- ark:- |" | |
mfcc_pitch_feats_rspecifier = ( | |
"ark,s,cs:"+mfcc_pitch_command | |
) | |
paste_command = f"paste-feats --length-tolerance=2 '{mfcc_feats_rspecifier}' '{mfcc_pitch_feats_rspecifier}' ark:- |" | |
paste_feats_rspecifier = ( | |
"ark:"+paste_command | |
) | |
copy_command = f"copy-feats --compress=true \"{paste_feats_rspecifier}\" ark,scp:raw_mfcc_pitch.ark,raw_mfcc_pitch.scp" | |
copy_feats_rspecifier = ( | |
copy_command | |
) | |
splice_command = f"splice-feats \"{paste_feats_rspecifier}\" ark:- |" | |
splice_feats_rspecifier = ( | |
"ark:"+splice_command | |
) | |
trans_command = f"{splice_command} transform-feats model/final.mat ark:- ark:- |" | |
trans_feats_rspecifier = ( | |
"ark,s,cs:"+trans_command | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment