我已经使用我的语言模型将我的语音解码为音素。我需要将语音分割成句子和单词。我知道,ctm 文件会有所帮助。谁能告诉我如何为特定的语音实例生成 ctm 文件?
1 回答
0
从识别器中转储单词时间的代码:
int frame_rate = cmd_ln_int32_r(config, "-frate");
ps_seg_t *iter = ps_seg_iter(ps, NULL);
while (iter != NULL) {
int32 sf, ef, pprob;
float conf;
ps_seg_frames(iter, &sf, &ef);
pprob = ps_seg_prob(iter, NULL, NULL, NULL);
conf = logmath_exp(ps_get_logmath(ps), pprob);
printf("%s %.3f %.3f %f\n", ps_seg_word(iter), ((float)sf / frame_rate),
((float) ef / frame_rate), conf);
iter = ps_seg_next(iter);
}
于 2015-12-14T14:29:02.083 回答