1 #include <pocketsphinx.h> 2 #include <stdio.h> 3 #include <string.h> 4 5 #include "pocketsphinx_internal.h" 6 #include "test_macros.h" 7 #include "ps_test.c" 8 9 int 10 main(int argc, char *argv[]) 11 { 12 cmd_ln_t *config; 13 ps_decoder_t *ps; 14 FILE *rawfh; 15 char const *hyp; 16 char const *uttid; 17 int32 score; 18 19 TEST_ASSERT(config = 20 cmd_ln_init(NULL, ps_args(), TRUE, 21 "-hmm", DATADIR "/an4_ci_cont", 22 "-lm", MODELDIR "/lm/en/turtle.DMP", 23 "-dict", MODELDIR "/lm/en/turtle.dic", 24 "-mllr", DATADIR "/mllr_matrices", 25 "-samprate", "16000", NULL)); 26 27 TEST_ASSERT(ps = ps_init(config)); 28 TEST_ASSERT(rawfh = fopen(DATADIR "/goforward.raw", "rb")); 29 ps_decode_raw(ps, rawfh, "goforward", -1); 30 fclose(rawfh); 31 hyp = ps_get_hyp(ps, &score, &uttid); 32 printf("FWDFLAT (%s): %s (%d)\n", uttid, hyp, score); 33 ps_free(ps); 34 cmd_ln_free_r(config); 35 return 0; 36 } 37