Menu

Can't use Pocketsphinx in my program

Help
2011-06-26
2012-09-22
  • __ParaPik__

    __ParaPik__ - 2011-06-26

    Hello all,
    I have some problems with Pocketsphinx. I decided to integrate speech
    recognition in my application. For it I've created a dll project which has
    some functions to start, stop and so on speech recognition.
    Init function of this project contains code of the tutorial for Pocketsphinx.
    This code works great when I use it in the console application. But in my case
    I have an accesses violation exception when my init function calls
    ps_init. This exception is raised in _lock_file. All files (acoustic
    model, dictionary, grammar) are available. Here are the stack trace and the
    part of the console output:

    Console output:
    INFO: acmod.c(242): Parsed model-specific feature parameters from
    acoustic/feat.params
    INFO: fe_interface.c(289): You are using internal mechanism to generate the
    seed.
    INFO: feat.c(289): Initializing feature stream to type: '1s_c_d_dd',
    ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(142): mean= 12.00, mean= 0.0
    INFO: acmod.c(153): Reading linear feature trasformation from
    acoustic/feature.transform
    INFO: mdef.c(520): Reading model definition: acoustic/mdef
    INFO: bin_mdef.c(173): Allocation 104810 * 8 bytes (818 KiB) for CD tree
    INFO: tmat.c(205): Reading HMM transition probability matrices:
    acoustic/transition_matrices (After it I have crash)

    Stack trace:
    ntdll.dll!774f8db9()

    ntdll.dll!774f8cc8()

    msvcr100.dll!_lock_file(_iobuf * pf) Line 236 + 0xa bytes C
    msvcr100.dll!fgets(char * string, int count, _iobuf * str) Line 71 + 0x6 bytes
    C
    sphinxbase.dll!002319ef()
    msvcr100.dll!_unlock(int locknum) Line 375 C
    msvcr100.dll!_unlock_file(_iobuf * pf) Line 313 + 0xe bytes C
    msvcr100.dll!fread_s(void * buffer, unsigned int bufferSize, unsigned int
    elementSize, unsigned int count, _iobuf * stream) Line 113 + 0x8 bytes C
    msvcr100.dll!fread(void * buffer, unsigned int elementSize, unsigned int
    count, _iobuf * stream) Line 303 + 0x13 bytes C
    sphinxbase.dll!00231743()
    sphinxbase.dll!00231cbf()

    Thanks for your answers.

     
  • Nickolay V. Shmyrev

    sphinxbase was compiled iwth MultiThreadedDLL runtime, see in vcxproj

          <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
    

    If you don't compile your project with similar setting it will crash. Use
    proper runtime or recompile sphinxbase

     
  • __ParaPik__

    __ParaPik__ - 2011-06-26

    My project was compiled with this option. The similar problem was with bw
    tool. It was solved by changing runtime library. Unfortunately it doesn't work
    in my case.

     
  • __ParaPik__

    __ParaPik__ - 2011-06-26

    Never mind. I decided to recompile sphinxbase and pocketsphinx again. So now
    everything works ok. Thank you, nshmyrev, for your answer.

     

Log in to post a comment.