Menu

Looking for Pocketsphinx wrapper for working with the CMU dict to extract phonetic transcriptions of words

Help
2015-08-07
2015-08-11
  • Benjamin Gorman

    Benjamin Gorman - 2015-08-07

    I'm using pocketsphinx to generate automated transcriptions of audio files and so far I'm getting on great, and I have output such as for each word in my audio file. Just a timestamped begin/end transcription.

    <key>
        <flag>if</flag>
        <time>00:00:00:090</time>
        <endtime>00:00:00:760</endtime>
        <value>1</value>
    </key>
    

    My question is I would also like the phonetic prouninciation included in the transcription. I can see there is a python wrapper for the https://github.com/cmusphinx/cmudict dictionary at https://github.com/cmusphinx/cmudict-tools

    Does pocketsphinx have something like this wrapper built in somewhere and if not is there either a simple way to implement it myself or another library out there I can modify?

    My current code that gets my transcription is is (with my xml file encoding excluded as it's not relevant)

    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);
    
        //here is where we process the word
    
        new_utterance new_utt;
        new_utt.conf = conf;
        new_utt.sf = sf;
        new_utt.st = (float)sf / frame_rate;
        new_utt.ef = ef;
        new_utt.et = (float) ef / frame_rate;
        new_utt.utt = ps_seg_word(iter);
    
        printf("Recognised: %s %.3f %.3f %f\n", ps_seg_word(iter), new_utt.st,
               new_utt.et, new_utt.conf);
    
        std::string word = ps_seg_word(iter);
    
     

    Last edit: Benjamin Gorman 2015-08-07
  • Benjamin Gorman

    Benjamin Gorman - 2015-08-11

    I came up with a solution to my problem.

    My https://github.com/benjgorman/ofxAutomatedCaptions shows how I solved it for future reference.

     

Log in to post a comment.