>>> module_dir, module_name = os.path.split(__file__)
>>> infilename = os.path.join(module_dir, "start.mmf")
>>> fd, outfilename = tempfile.mkstemp(prefix='tmp', suffix='.am')
>>> os.close(fd)
>>> htkmmf2native(infilename, outfilename)
Now test output
>>> with open(infilename) as f_in:
... models_in, hmm_mgr_in, gmm_mgr_in = read_htk_mmf_file(f_in)
>>> with open(outfilename) as f_out:
... models_out, gmm_mgr_out, hmm_mgr_out = hmm_mgr.read_acoustic_model(f_out)
>>> models_in == models_out
True
>>> gmm_mgr_in == gmm_mgr_out
True
>>> hmm_mgr_in == hmm_mgr_out
True
>>> #print(outfilename)
>>> os.unlink(outfilename)
>>> infilename = os.path.join(module_dir, "monophones.mmf")
>>> fd, outfilename = tempfile.mkstemp(prefix='tmp', suffix='.am')
>>> os.close(fd)
>>> htkmmf2native(infilename, outfilename)
Now test output
>>> with open(infilename) as f_in:
... models_in, hmm_mgr_in, gmm_mgr_in = read_htk_mmf_file(f_in)
>>> with open(outfilename) as f_out:
... models_out, gmm_mgr_out, hmm_mgr_out = hmm_mgr.read_acoustic_model(f_out)
>>> models_in == models_out
True
>>> gmm_mgr_in == gmm_mgr_out
True
>>> hmm_mgr_in == hmm_mgr_out
True
>>> #print(outfilename)
>>> os.unlink(outfilename)