I have decoded my speech into phonemes by using my language model.I need to segment the speech into sentences and words.I know , a ctm file will help .Can anyone tell me how to generate the ctm file for a particular speech instance ?
Asked
Active
Viewed 160 times
1 Answers
0
The code to dump word times from the recognizer:
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);
}

Nikolay Shmyrev
- 24,897
- 5
- 43
- 87
-
Thanks for the code ! And , how do I get the CTM file for a given speech instance? – Kaushik Ramachandran Dec 15 '15 at 03:24