Menu

using pocketsphinx in c#

Help
2012-08-10
2012-09-22
  • james barrett

    james barrett - 2012-08-10

    im trying to use pocketsphinx continuous listening in a program entirely in
    c#. i have starting learning how to access the functions i need usind dll
    import but i was wondering instead of capturing audio then converting it so
    its compatable, can i just tell pocketsphinx which microphone to use and let
    pocketsphinx format the live audio correctly? also im having trouble with how
    to call the start function(listener) and retrieve(result).

    also i have found similar problems on the forums from other people but im not
    understanding a soloution clearly .
    i need child like instruction lol
    many thanks
    James.

     
  • james barrett

    james barrett - 2012-08-10

    so im calling my .dll files from c#

    then im trying to call a funtion that starts the listening

    public static extern void ps_init();

    im trying to call

    but get error because im not sure of how to finish the dllimport i.e "public
    static extern void ps_init();" ?

    then i need to retrieve the answer/string

    thankful for any help as i have looked at loads of examples but because im not
    a coder its confusing.

     
  • tthung

    tthung - 2012-08-11

    Hi James, I don't clearly understand your question, but I really want to help
    you.
    The alternative way to use pocketsphinx in C# is: You use C# function to make
    pocketsphinx run in command line windows. and then you use C# to get to the
    result after recognition.
    If you need source code for calling pocketsphinx run in cmd and get the
    result. You can mail me: tonthanhhung90@gmail.com.
    I know it's not formal but it works efficiently.
    What you need is
    1. To try built and run poecketsphinx as construction here: http://cmusphinx.sourceforge.net/wiki/tutorialpocketsphinx
    2. You have to prepare your appropriate hmm model, grammar, dict file (you need some knowledge of creating that, it's not to hard but time consumming)
    3. Know how to use your above models in #1
    after you can built and run pocketsphinx in cmd, you can contact me for
    connecting C# to it.

    Sorry for my English, it's not fluent and correct.I'm so sorry if you guy
    don't get it. for long time I don't English

     
  • james barrett

    james barrett - 2012-08-11

    thank you so much for your reply , im having trouble at the moment because im
    trying to package it into a plugin for unity3d game engine , so im not sure if
    starting a command line instance with c# is correct way for me to do it , but
    if you dont mind i will email you and if u can send me the code it will help
    me understand how your calling the functions, i can run pocketsphinx in
    command line on my windows machine and it works and it even gets the correct
    word im saying sometimes lol
    but my coding knowledge is limited as its just my hobby and learning something
    so vast is difficult
    many thanks
    J
    ames

     
  • james barrett

    james barrett - 2012-08-11

    to be more clear also

    1. exactly which files do i need to include to make it non dependent on main pocketsphinx folder i.e
      pocketsphinx.dll , sphinxbae.dll the model folder , and which header files?

    2. if im including sphinxbase using dllimport what are the second arguments??

    i.e
    ????????? public static extern void ps_init(); ?????????

    also

    ????????? public static extern void ps_init(); ?????????

     
  • Nickolay V. Shmyrev

    1. if im including sphinxbase using dllimport what are the second
      arguments??

    The arguments depends on the function. You can learn a little bit about
    dllimport and wrappers in a tutorial:

    http://msdn.microsoft.com/en-
    us/library/aa288468%28v=vs.71%29.aspx?ppud=4

     

Log in to post a comment.