Monday, September 13, 2010

[Linux] Convert binary HTK format HMM model file (MMF) to ASCII format

While training HMM models using HTK, we could decide whether the gained model is stored in binary format or not using the option "-B".

How about if we get a binary model from others and we want to manipulate it?

If the operations to carry on are supported by HTK's tool HHED, then just write a correct editing script for HHED and use it.

What if not supported?

The easiest way it to convert it to ASCII format and do whatever you like.

To convert the binary MMF model to ASCII format, we still need the HHED tool.

Simply create an empty file as the editing script and then use HHED to load the binary model, do editing (nothing would be done), and save the mode out in ASCII format!

The command is simple:

HHED -H <the original binary MMF file> -M <output folder for the ASCII model> <the empty editing script file> <the model list>

Posted via email from Troy's posterous


  1. HEy :)
    Do you know how to do the opposite ? (ASCII to binary?)

    Please mail me :

    Best regards!

    1. In fact it looks like it only works with HMM, but I am trying to do it with MFC files :( any idea ?
      I can list a binary MFC file using hlist -h -t file.mfc but I don't know how to do the other way round... ASCII to Binary mfc.

      Any help would be kindly appreciated!

  2. Hi, is there any reference material about the actual binary format of HTK hmm def files