Speech Recognition Engines

.mfc files
User: Tanmoy Mukherjee
Date: 8/27/2009 1:54 am
Views: 4329
Rating: 5

Hi.......My question is that i extract some part of .mfc files which i change to a simple .txt file. In short lets say that a wave file has 300 frames and i want to get the one from 100 to 120. so i use cepview and then append it to a .txt file. Now i want this .txt file to be converted into the binary format which can be recognized by Sphinx......Any clue from any one on how to do it.




--- (Edited on 8/27/2009 1:54 am [GMT-0500] by Visitor) ---

Re: .mfc files
User: nsh
Date: 8/27/2009 3:25 pm
Views: 1777
Rating: 5

It's rather trivial to write a C program that will read a text file and dump a binary file. The format of mfc file is trivial. It's a header with the length of data and a float data in binary form each for 4 bytes.

Write header

 outfp = fopen ("result.mfc", "wb");
int fcount = nframes * 13;
int swap_count = bswap_32(fcount);
fwrite (&swap_count, 1, 4, outfp);

write data

 for (i=0; i<nframes;i++)

    for (j=0;j<13; j++)

       fwrite (&frame[j], 1, 4, outfp);

close file


that's all.


--- (Edited on 8/27/2009 3:25 pm [GMT-0500] by nsh) ---