Hello
i want to cross-compile my C file but i have a problem with model dir , i used an example from the tuto in the web site of sphinx :
include <pocketsphinx.h></pocketsphinx.h>
int
main(int argc, char argv[])
{
ps_decoder_t ps; // the decoder ( engine )
cmd_ln_t config; // configuration object
FILE fh;
char const hyp, uttid; // l'hypothese de mot et ID de stream de parole %
int16 buf[512]; //la parole est parser dans des buf de 512
int rv; // id de la parti
int32 score;
config=cmd_ln_init(NULL,ps_args(),TRUE,"-hmm","/usr/local/share/pocketsphinx/model/en-us/cmudict-en-us.dict","-lm","/usr/local/share/pocketsphinx/model/en-us/8888.lm.bin",//lesdict/lm/hmm--->modeldir=dossiercdumodelle"-dict","/usr/local/share/pocketsphinx/model/en-us/8888.dict",NULL);if(config==NULL){fprintf(stderr,"Failed to create config object, see log for details\n");return-1;}ps=ps_init(config);//ajouterlemodelaudecodeurif(ps==NULL){fprintf(stderr,"Failed to create recognizer, see log for details\n");return-1;}//fichieraparser,leinputfilefh=fopen("light.raw","rb");if(fh==NULL){fprintf(stderr,"Unable to open input file goforward.raw\n");return-1;}rv=ps_start_utt(ps);//readaudiodatafromasourceandfeedittothedecoderwhile(!feof(fh)){size_tnsamp;nsamp=fread(buf,2,512,fh);rv=ps_process_raw(ps,buf,nsamp,FALSE,FALSE);////read512samplesatatimefromthefile,andfeedthemtothedecoder}rv=ps_end_utt(ps);//findestreamparole:marktheendoftheutterence=paroleshyp=ps_get_hyp(ps,&score);//ondonnel'hypothese de la mot identifier printf("Recognized: %s\n",hyp);//oubiensendittotheserverjsonRPC//------------->donchypestunechainedecaractereconstantequicontientlacommande,return,mettredansunfichierorwhateverfclose(fh);ps_free(ps);cmd_ln_free_r(config);return0;
Hello
i want to cross-compile my C file but i have a problem with model dir , i used an example from the tuto in the web site of sphinx :
include <pocketsphinx.h></pocketsphinx.h>
int
main(int argc, char argv[])
{
ps_decoder_t ps; // the decoder ( engine )
cmd_ln_t config; // configuration object
FILE fh;
char const hyp, uttid; // l'hypothese de mot et ID de stream de parole %
int16 buf[512]; //la parole est parser dans des buf de 512
int rv; // id de la parti
int32 score;
}
and for the make file is in attachement
What is the problem exactly? You are not quite clear.