Has someone already use pocketsphinx on c# project?
I am trying to do it, but it is the first time in speech recognition and it is
a little bit difficult...
I have not found any exemple on it!
Please help lol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has someone already use pocketsphinx on c# project?
Yes
I am trying to do it, but it is the first time in speech recognition and it
is a little bit difficult...
We are here to help you
I have not found any exemple on it!
There are things in this world you will not find example. In your daily life
you can proceed without examples, try to apply this knowledge to software
development. Sometimes you need to turn on your brain.
On this particular problem you can find the information on using C library
from C# here:
Hello and thanks to be there nshmyrev
My first problem is this one:
I read those lignes http://cmusphinx.sourceforge.net/wiki/tuturialpocketsphin
x but i am not
sure in what i had to do...
I have compile pocketsphinx and sphinxbase, but what did i import in the c#
project? if i understand i only import .exe and dll is that right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So i had to import pocketsphinx.dll and sphinxbase.dll on the project that's
all?
I have seen how to use it with and "using System.Runtime.InteropServices;"
I wil try with the tutorial but for the moment i dont understand how to do...
i think I lack knowledge to use a such tool
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So i had to import pocketsphinx.dll and sphinxbase.dll on the project that's
all?
I have seen how to use it with and "using System.Runtime.InteropServices;"
Yes, that's the way
I wil try with the tutorial but for the moment i dont understand how to
do... i think I lack knowledge to use a such tool
We would be glad to answer your questions, but you need to ask more specific
ones.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We would be glad to answer your questions, but you need to ask more specific
ones.
Thank fo that and for your patience, i am very glad to work on speech
recognition but it is new and quiet difficult for mee, i am beginer like
developer...
I tried to use a c++ dll and i sucess,she was quiet simple.
So in the tutorial on part "Code listing", if i understand this code
transcribe a stream (voice on microphone) and print on screen the recognize
"text" is that right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So in the tutorial on part "Code listing", if i understand this code
transcribe a stream (voice on microphone) and print on screen the recognize
"text" is that right?
Code listing takes audio data from a file, not from a microphone. Yes, it
outputs recognized text on the screen.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes it is right sorry... So i just have to "convert" this code to c#! Thanks
One more question! Is the file format defined or did it works with a .wav
file?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it was you that sent me an e-mail yesterday..
Regarding that issue, yes i was able to make pocketsphinx run along my c#
application..
You have to write a c# wrapper that makes the "bridge" between c++ (unmanaged
code) and c# ( managed code) .. as you figured out before using ...
The way i reached some success:
Open pocketsphinx project, specifically the file continuous.c .. this is the
example for creating pocketsphinx_continuous .. try to understand what happens
in "main()" and "utterance loop()" .. so you can develop methods on the
pocketsphinx dll that can be called from the c# project.
I think it was you that sent me an e-mail yesterday..
Yes corneyus it was me!
thank you for this answer with all post and doc i have read today i think this
is the better way but i dont know c++ and i dont think i will have time to
learn it (that is why i choose c#)... i will try to do it ;).
That is too bad for Universal Translator...
Thank for your help guys realy appreciate
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Complitely agreed but it is not my choice, like i said i do it for a company,
i am in "apprenticeship" (is it the good word?).
It was in the spesifications to use sphinx, but sphin is in Java it is
problematic since i only know c#, that is why i am trying to do it with
pocketsphinx ... interopertates between c++ and c# is probably easyer than
java and c#.
My application is well advanced it lake speech recognition... but i have
already do the same with SAPI (microsoft), however the company won't be
dependant on microsoft. That is my story lol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I'm trying to use pocketsphinx to make one social robot. I use this
code and works good:
#include <pocketsphinx.h>#define MODELDIR "/usr/share/pocketsphinx/model"intmain(intargc,char*argv[]){ps_decoder_t*ps;cmd_ln_t*config;FILE*fh;charconst*hyp,*uttid;int16buf[512];intrv;int32score;config=cmd_ln_init(NULL,ps_args(),TRUE,"-hmm",MODELDIR"/hmm/en_US/hub4_wsj_sc_3s_8k.cd_semi_5000","-lm",MODELDIR"/lm/en/turtle.DMP","-dict",MODELDIR"/lm/en/turtle.dic",NULL);if(config==NULL)return1;ps=ps_init(config);if(ps==NULL)return1;fh=fopen("/home/pablo/pfc/ordenes_de_voz/daironNumbers.wav","rb");if(fh==NULL){perror("Failed to open daironNumbers.raw");return1;}rv=ps_decode_raw(ps,fh,"daironNumbers",-1);if(rv<0)return1;hyp=ps_get_hyp(ps,&score,&uttid);if(hyp==NULL)return1;printf("Recognized: %s\n",hyp);fseek(fh,0,SEEK_SET);rv=ps_start_utt(ps,"daironNumbers");if(rv<0)return1;while(!feof(fh)){size_tnsamp;nsamp=fread(buf,2,512,fh);rv=ps_process_raw(ps,buf,nsamp,FALSE,FALSE);}rv=ps_end_utt(ps);if(rv<0)return1;hyp=ps_get_hyp(ps,&score,&uttid);if(hyp==NULL)return1;printf("Recognized: %s\n",hyp);fclose(fh);ps_free(ps);return0;}
I want to use the microphone in some moments of my program, and i don't know
what's are the functions that configure the microphone, open, and translate
all what i say. I think that i must use that function:
I am trying to write a C# cover using pocketsphinx.dll.
Can someone please help me on how I can translate the following functions from
pocketsphinx :
SPHINXBASE_EXPORT
int32 cont_ad_read (cont_ad_t r, /< In: Object pointer returned by
cont_ad_init /
int16 buf, /< In/Out: In block mode, contains input data.
On return, buf contains A/D data returned
by this function, if any. /
int32 max /*< In: Maximum number of samples to be filled into buf.
NOTE: max must be at least 256; otherwise
the functions returns -1. /
);
SPHINXBASE_EXPORT
cont_ad_t cont_ad_init (ad_rec_t ad, /< In: The A/D source object to be
filtered /
int32 (adfunc)(ad_rec_t ad, int16 buf, int32 max)
/< In: adfunc = source function to be invoked
to obtain raw A/D data. See ad.h for the
required prototype definition. */
);
I don't think this part of the API is translatable to C#. It doesn't meant to
be used in bindings. I suggest you to design another API and implement it in
C#. For example it could look this way
I'm building a C# application that uses pocketSphinx recognizer. I have built
the pocketSphinx and sphinxBase solutions in Visual Studio 2010 and obtained
the pocketSphinx.dll and sphinxbase.dll, which I will import into the C# code
using the command. My questions are:
As mentioned in the above posts, what is the using "System.Runtime.InteropServices;" command for?
Once you import the dll's, what steps do you have to do to use pocketSphinx_continuous? Would there be some documentation or examples that illustrate that?
I'm sorry, but simple online searching did not result in any concrete links,
but I'm sure that this has been done extensively in the past.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I build my own wrapper a while ago. It's not that hard.
As mentioned in the above posts, what is the using
"System.Runtime.InteropServices;" command for?
DLLImport is part of System.Runtime.InteropServices
for calling any unmanaged dll, such as pocketsphinx or sphinxbase, you need
that.
Once you import the dll's, what steps do you have to do to use
pocketSphinx_continuous? Would there be some documentation or examples that
illustrate that?
There is no documentation for that (unfortunately), but the way that i did
that was building an interface in C (a project like pocketsphinx_continuous)
where I know what's my input and what output I expect. Then importing that
into my C# project.
That way it was easier for me to manage Marshaling in C#, but you can either
do that or call C functions from your C# project.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, aspersica! Would you mind sharing your C#/C interface that imported
the pocketSphinx and sphinxBase DLLs and then went on to use them. Having a
sample would be of great value. Thank you so much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, aspersica! Would you mind sharing your C#/C interface that imported
the pocketSphinx and sphinxBase DLLs and then went on to use them. Having a
sample would be of great value. Thank you so much.
Sorry, that code is now part of a product, so I can't distribute that code.
But it's easy. You won't have problem writing that yourself, and you always
can ask question here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has someone already use pocketsphinx on c# project?
I am trying to do it, but it is the first time in speech recognition and it is
a little bit difficult...
I have not found any exemple on it!
Please help lol
Yes
We are here to help you
There are things in this world you will not find example. In your daily life
you can proceed without examples, try to apply this knowledge to software
development. Sometimes you need to turn on your brain.
On this particular problem you can find the information on using C library
from C# here:
http://blogs.msdn.com/b/jonathanswift/archive/2006/10/02/780637.aspx
LOL indeed
Hello and thanks to be there nshmyrev
My first problem is this one:
I read those lignes http://cmusphinx.sourceforge.net/wiki/tuturialpocketsphin
x but i am not
sure in what i had to do...
I have compile pocketsphinx and sphinxbase, but what did i import in the c#
project? if i understand i only import .exe and dll is that right?
Please check updated tutorial page again to learn more about pocketsphinx API
Only dll
So i had to import pocketsphinx.dll and sphinxbase.dll on the project that's
all?
I have seen how to use it with and "using System.Runtime.InteropServices;"
I wil try with the tutorial but for the moment i dont understand how to do...
i think I lack knowledge to use a such tool
Yes, that's the way
We would be glad to answer your questions, but you need to ask more specific
ones.
Thank fo that and for your patience, i am very glad to work on speech
recognition but it is new and quiet difficult for mee, i am beginer like
developer...
I tried to use a c++ dll and i sucess,she was quiet simple.
So in the tutorial on part "Code listing", if i understand this code
transcribe a stream (voice on microphone) and print on screen the recognize
"text" is that right?
Code listing takes audio data from a file, not from a microphone. Yes, it
outputs recognized text on the screen.
Yes it is right sorry... So i just have to "convert" this code to c#! Thanks
One more question! Is the file format defined or did it works with a .wav
file?
Do you think it is possible to do it in c++ and after that to launch it wif an
audio file as parameter by c# application?
hello juju49l..
I think it was you that sent me an e-mail yesterday..
Regarding that issue, yes i was able to make pocketsphinx run along my c#
application..
You have to write a c# wrapper that makes the "bridge" between c++ (unmanaged
code) and c# ( managed code) .. as you figured out before using ...
The way i reached some success:
Open pocketsphinx project, specifically the file continuous.c .. this is the
example for creating pocketsphinx_continuous .. try to understand what happens
in "main()" and "utterance loop()" .. so you can develop methods on the
pocketsphinx dll that can be called from the c# project.
There was an insteresting project who had some info on this, but the page
seems it's not working:
http://users.ece.gatech.edu/~hamblen/489X/S10proj/Universal_Translator/sites.
google.com/site/utrans10/home.html
http://www.youtube.com/watch?v=PDUI6iomQYQ
it was called Universal Translator..
good luck and keep us posted
Yes corneyus it was me!
thank you for this answer with all post and doc i have read today i think this
is the better way but i dont know c++ and i dont think i will have time to
learn it (that is why i choose c#)... i will try to do it ;).
That is too bad for Universal Translator...
Thank for your help guys realy appreciate
if you are learning a language.. i would say to be comfortable with it before
"diving" into the pocketsphinx code.. just my 2 cents..
Complitely agreed but it is not my choice, like i said i do it for a company,
i am in "apprenticeship" (is it the good word?).
It was in the spesifications to use sphinx, but sphin is in Java it is
problematic since i only know c#, that is why i am trying to do it with
pocketsphinx ... interopertates between c++ and c# is probably easyer than
java and c#.
My application is well advanced it lake speech recognition... but i have
already do the same with SAPI (microsoft), however the company won't be
dependant on microsoft. That is my story lol
Hum... i too am going from SAPI to pocketsphinx to measure results...
As for java and c#... if you know c#, java is easy to learn...
it all depends on what final result you are looking for ..
another link that might help you with pocketsphinx specifically
http://www.astalavista.com/topic/29952-hack-adding-speech-recognition-to-
your-embedded-platform/
Hello, I'm trying to use pocketsphinx to make one social robot. I use this
code and works good:
I want to use the microphone in some moments of my program, and i don't know
what's are the functions that configure the microphone, open, and translate
all what i say. I think that i must use that function:
hyp = ps_get_hyp(ps, &score, &uttid)
once collect from the micro but I have looked for in the API : http://cmusphi
nx.sourceforge.net/api/pocketsphinx/
But i don't found anything.
Can you help me please?
Thanks!!
API to access microphone is here
http://cmusphinx.sourceforge.net/api/sphinxbase/ad_8h.html
To see how this API could be used see pocketsphinx_continuous source:
http://cmusphinx.svn.sourceforge.net/viewvc/cmusphinx/trunk/pocketsphinx/src/
programs/continuous.c?revision=10581&view=markup
Hi,
I am trying to write a C# cover using pocketsphinx.dll.
Can someone please help me on how I can translate the following functions from
pocketsphinx :
SPHINXBASE_EXPORT
int32 cont_ad_read (cont_ad_t r, /< In: Object pointer returned by
cont_ad_init /
int16 buf, /< In/Out: In block mode, contains input data.
On return, buf contains A/D data returned
by this function, if any. /
int32 max /*< In: Maximum number of samples to be filled into buf.
NOTE: max must be at least 256; otherwise
the functions returns -1. /
);
SPHINXBASE_EXPORT
cont_ad_t cont_ad_init (ad_rec_t ad, /< In: The A/D source object to be
filtered /
int32 (adfunc)(ad_rec_t ad, int16 buf, int32 max)
/< In: adfunc = source function to be invoked
to obtain raw A/D data. See ad.h for the
required prototype definition. */
);
SPHINXBASE_EXPORT
cont_ad_t cont_ad_init_rawmode (ad_rec_t ad,
int32 (adfunc)(ad_rec_t ad, int16 *buf, int32 max));
Thank you so much.:)
Hello sweththegr8
I don't think this part of the API is translatable to C#. It doesn't meant to
be used in bindings. I suggest you to design another API and implement it in
C#. For example it could look this way
Any successful results on building a C# API for pocket sphinx?
I'm about to start my project on it, and I appreciate if anyone can share a
successful experience with me.
Bests,
Amin
Any luck with the C# wrapper for pocketsphinx?
I'm building a C# application that uses pocketSphinx recognizer. I have built
the pocketSphinx and sphinxBase solutions in Visual Studio 2010 and obtained
the pocketSphinx.dll and sphinxbase.dll, which I will import into the C# code
using the command. My questions are:
I'm sorry, but simple online searching did not result in any concrete links,
but I'm sure that this has been done extensively in the past.
Thanks.
I build my own wrapper a while ago. It's not that hard.
DLLImport is part of System.Runtime.InteropServices
for calling any unmanaged dll, such as pocketsphinx or sphinxbase, you need
that.
There is no documentation for that (unfortunately), but the way that i did
that was building an interface in C (a project like pocketsphinx_continuous)
where I know what's my input and what output I expect. Then importing that
into my C# project.
That way it was easier for me to manage Marshaling in C#, but you can either
do that or call C functions from your C# project.
Thanks, aspersica! Would you mind sharing your C#/C interface that imported
the pocketSphinx and sphinxBase DLLs and then went on to use them. Having a
sample would be of great value. Thank you so much.
BTW, I realized that pasting a somewhat huge piece of code online might be
cumbersome, so if you'd prefer, you could email me at: anujkumar9@gmail.com
Sorry, that code is now part of a product, so I can't distribute that code.
But it's easy. You won't have problem writing that yourself, and you always
can ask question here.