【声纹识别】 kaldi callhome diarization

callhome diarization kaldi 中专门用来进行混合录音文件聚类分别的,

主要参考blog-->操作指南

学会自己看kaldi中的 指令demo。

个人操作如下:

teps/segmentation/detect_speech_activity.sh --cmd 'run.pl' --nj 1 --mfcc-config ./conf/mfcc_hires.conf --extra-left-context 79 --extra-right-context 21 --extra-left-context-initial 0 --extra-right-context-final 0 --frames-per-chunk 150 data/ljj exp/segmentation_1a/tdnn_stats_asr_sad_1a exp/mfcc_hires exp/segmentation_sad_snr/nnet_tdnn_j_ljj data/ljj
 
steps/make_mfcc.sh --mfcc-config conf/mfcc.conf --nj 1 --cmd "run.pl" --write-utt2num-frames true data/ljj_seg exp/make_mfcc mfcc 

utils/fix_data_dir.sh data/ljj_seg
 
 #  倒谱均值方差归一化(CMVN)  
 local/nnet3/xvector/prepare_feats.sh --nj 1 --cmd "run.pl" data/ljj_seg data/ljj_seg_cmn exp/ljj_seg_cmn
 
 cp data/ljj_seg/segments data/ljj_seg_cmn/
 
 utils/fix_data_dir.sh data/ljj_seg_cmn
 
 diarization/nnet3/xvector/extract_xvectors.sh --cmd "run.pl"  --nj 1 --window 1.5 --period 0.75 --apply-cmn false --min-segment 0.5 exp/xvector_nnet_1a  data/ljj_seg_cmn exp/xvectors_ljj_seg
 
 diarization/nnet3/xvector/score_plda.sh --cmd "run.pl --mem 4G" --nj 1 --target-energy 0.9  exp/xvector_nnet_1a/xvectors_callhome1 exp/xvectors_ljj_seg exp/xvectors_ljj_seg/plda_scores
 
 diarization/cluster.sh --cmd "run.pl --mem 4G" --nj 1 --reco2num-spk data/ljj_seg/reco2num_spk exp/xvectors_ljj_seg/plda_scores exp/xvectors_ljj_seg/plda_scores_num_speakers
 #  如果知道有多少人说话 则需要生成 --reco2num-spk data/ljj_seg/reco2num_spk
 
 diarization/cluster.sh --cmd "run.pl --mem 4G" --nj 1 --threshold 0 exp/xvectors_ljj_seg/plda_scores exp/xvectors_ljj_seg/plda_scores_threshold_0
 
 
 第二列是文件名,第三列是开始时间,第四列是移动时间 第五列是 从移动时间开始 多少时间算一份  第八列是文件的label
如下是 已知文件有几个人说话的时候
SPEAKER 18642259056-liujinjie.wav 0   0.000   4.510   1  
SPEAKER 18642259056-liujinjie.wav 0   4.530   1.660   2  
SPEAKER 18642259056-liujinjie.wav 0   6.210   4.880   2  
SPEAKER 18642259056-liujinjie.wav 0  11.090   1.660   1  
SPEAKER 18642259056-liujinjie.wav 0  12.800   2.130   1  
SPEAKER 18642259056-liujinjie.wav 0  14.950   4.400   2  
SPEAKER 18642259056-liujinjie.wav 0  19.390   1.810   2  
SPEAKER 18642259056-liujinjie.wav 0  21.220   5.220   2  
SPEAKER 18642259056-liujinjie.wav 0  26.440   4.410   1  
SPEAKER 18642259056-liujinjie.wav 0  30.850   2.480   2  
SPEAKER 18642259056-liujinjie.wav 0  33.340   5.120   2  
SPEAKER 18642259056-liujinjie.wav 0  38.460   5.990   1  
SPEAKER 18642259056-liujinjie.wav 0  44.480   3.910   1  
SPEAKER 18642259056-liujinjie.wav 0  48.460   3.460   1  
SPEAKER 18642259056-liujinjie.wav 0  52.060   5.420   1  
SPEAKER 18642259056-liujinjie.wav 0  57.530   5.030   1  


如下是 不知文件有几个人说话的时候
SPEAKER 18642259056-liujinjie.wav 0   0.000   4.510   1  
SPEAKER 18642259056-liujinjie.wav 0   4.530   1.660   3  
SPEAKER 18642259056-liujinjie.wav 0   6.210   4.880   2  
SPEAKER 18642259056-liujinjie.wav 0  11.090   1.660   1  
SPEAKER 18642259056-liujinjie.wav 0  12.800   2.130   1  
SPEAKER 18642259056-liujinjie.wav 0  14.950   4.400   2  
SPEAKER 18642259056-liujinjie.wav 0  19.390   1.810   2  
SPEAKER 18642259056-liujinjie.wav 0  21.220   5.220   2  
SPEAKER 18642259056-liujinjie.wav 0  26.440   4.410   1  
SPEAKER 18642259056-liujinjie.wav 0  30.850   2.480   2  
SPEAKER 18642259056-liujinjie.wav 0  33.340   5.120   2  
SPEAKER 18642259056-liujinjie.wav 0  38.460   5.990   1  
SPEAKER 18642259056-liujinjie.wav 0  44.480   3.910   1  
SPEAKER 18642259056-liujinjie.wav 0  48.460   3.460   1  
SPEAKER 18642259056-liujinjie.wav 0  52.060   5.420   1  
SPEAKER 18642259056-liujinjie.wav 0  57.530   5.030   1  
 
接下来就是 用pydub 进行语音片段的拼接了

 

你可能感兴趣的:(声纹识别)