Thanasis - 2020-09-16

Hello, i've been working with Qt and C++ to create a simple GUI for pocketsphinx.

I've noticed though that when loading an MLLR matrix i get the following error:

INFO: ps_mllr.c(66): Reading MLLR transformation file '.../mllr_matrix.mllr'
ERROR: "ps_mllr.c", line 106: Failed reading MLLR rotation (0,0,0,1)

However the mllr matrix is fine (attaching it)
and i checked by passing it to pocketsphinx_continuous.
Playing around in my code to find the bug, i noticed that if i initialized the ps_decoder_t before starting a QApplication() the matrix is loaded just fine.

(I also tested with other Qt projects that use pocketsphinx from github and i get the same error)
Posting a sample of the code and just printing out ps_decoder_t.
ps_reinit() returns -1 when called inside ps_init().

The sample code:

#include <QApplication>
#include <pocketsphinx.h>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

        cmd_ln_t *config = nullptr;
        ps_decoder_t *ps = nullptr;
        config = cmd_ln_init(NULL, ps_args(), TRUE,
                                       "-backtrace", "yes",
                                       "-hmm", ".../pocketsphinx/share/pocketsphinx/model/en-us/en-us",
                                       "-lm", ".../pocketsphinx/share/pocketsphinx/model/en-us/en-us.lm.bin",
                                       "-mllr", "...//mllr_matrix.mllr",
                                       0);
        ps = ps_init(config);

        printf("Ps decoder is %p\n", ps);

        return a.exec();
}

Output (not pocketsphinx log, just stdout):
Ps decoder is (nil)

The mllr matrix was created with a en-us (ptm) model.
Please do try it with your MLLR matrices just to be sure.

Just reporting the error, for now i've moved to Vosk API.
Thanks