Hi. I just started trying to play with Sphinx. I followed their site as far as running sphinx-server. It is listening on the default port. I copied sphinx2-simple to another file and changed sphinx2-continuous to sphinx2-server. So, I ran eagi-sphinx-test under asterisk. What exactly is it supposted to do? Here's what I get: debian:~# sphinx2-simple2 sphinx2-simple: Demo CMU Sphinx2 decoder called with command line arguments. <executing /usr/local/bin/sphinx2-server, please wait> ioctl(SETDUPLEX) failed: Invalid argument Calibrating background noise level...done server.c(443): Bad or missing port# argument, using 7027 srvcore.c(382): Listening at port 7027 srvcore.c(409): Connected >>>>>>>> 192.168.1.99 at Thu Dec 18 15:24:19 2003 Hit <CR> to start listening, q<CR> to quit client connection -- Executing Answer("SIP/test-ff55", "") in new stack -- Executing EAGI("SIP/test-ff55", "eagi-sphinx-test") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/eagi-sphinx-test Environment: 'agi_request' is 'eagi-sphinx-test' Environment: 'agi_channel' is 'SIP/test-ff55' Environment: 'agi_language' is 'en' Environment: 'agi_type' is 'sip' Environment: 'agi_uniqueid' is '1071786651.21' Environment: 'agi_callerid' is '"blah" <1234>' Environment: 'agi_dnid' is 'unknown' Environment: 'agi_rdnis' is 'unknown' Environment: 'agi_context' is 'default' Environment: 'agi_extension' is '911' Environment: 'agi_priority' is '2' Environment: 'agi_enhanced' is '1.0' Environment: 'agi_accountcode' is '' Ooh, got a response from Asterisk: '200 result=0 endpos=46560' 1. Result is '200 result=0 endpos=46560' Ooh, got a response from Asterisk: '200 result=0 endpos=30720' 2. Result is '200 result=0 endpos=30720' -- Playing 'digits/20' (language 'en') -- Playing 'digits/3' (language 'en') -- Playing 'digits/million' (language 'en') -- Playing 'digits/4' (language 'en') -- Playing 'digits/hundred' (language 'en') -- Playing 'digits/50' (language 'en') -- Playing 'digits/2' (language 'en') -- Playing 'digits/thousand' (language 'en') -- Playing 'digits/3' (language 'en') -- Playing 'digits/hundred' (language 'en') -- Playing 'digits/40' (language 'en') -- Playing 'digits/5' (language 'en') Ooh, got a response from Asterisk: '200 result=0' 3. Result is '200 result=0' -- Playing 'demo-enterkeywords' (language 'en') Ooh, got a response from Asterisk: '200 result= (timeout)' 4. Result is '200 result= (timeout)' Ooh, got a response from Asterisk: '200 result=0 endpos=9440' 5. Result is '200 result=0 endpos=9440' -- AGI Script eagi-sphinx-test completed, returning 0 Is the endpos number something significant? What is it referring to? Am I doing this right? Does anyone have any other EAGI Sphinx examples? Maybe something that asks for you to say a word and it puts it into text? Sorry, this is pretty neat but there's hardly any information on it. I've tried searching the lists and I see a couple people that have used it but that's all. Thanks, Kevin B. _____________________________________________________________ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com
On Thu, 2003-12-18 at 15:40, Kevin Bockman wrote:> Hi. I just started trying to play with Sphinx. I followed their site as far as running sphinx-server. It is listening on the default port. I copied sphinx2-simple to another file and changed sphinx2-continuous to sphinx2-server. > > So, I ran eagi-sphinx-test under asterisk. What exactly is it supposted to do? Here's what I get: >eagi-sphinx-test.c has hardcoded values for the sphinx server. Change the values to suit your network and installation and try again. --Karl -- Karl Putland <karl@putland.linux-site.net>
On Thu, 2003-12-18 at 15:40, Kevin Bockman wrote:> Hi. I just started trying to play with Sphinx. I followed their site as far as running sphinx-server. It is listening on the default port. I copied sphinx2-simple to another file and changed sphinx2-continuous to sphinx2-server. > > So, I ran eagi-sphinx-test under asterisk. What exactly is it supposted to do? Here's what I get: >eagi-sphinx-test.c has hardcoded values for the sphinx server. Change the values to suit your network and installation and try again. --Karl -- Karl Putland <karl@putland.linux-site.net>
--- Karl Putland <karl@putland.linux-site.net> wrote:>eagi-sphinx-test.c has hardcoded values for the sphinx server. Change >the values to suit your network and installation and try again. > >--KarlYup, sorry I forgot to mention that. I have the correct IP and port in there. It was giving me errors before that. I'm just not sure what exactly is supposted to happen with the example. I don't see anything that would resemble speech recognition there except for those return codes but I don't know what significance those numbers would have. Using the sphinx testing applications, it says that you have to press return on the server before it starts the recognition. I see that asterisk connects and it asks for you to press enter. I don't get anything different if I press enter on the server. This doesn't seem right anyways. Is there some kind of other configuration that I need to have it just run in the background and automatically accept the connection and translate? Just was hoping for someone that has dealt with it more and that maybe had a better Sphinx EAGI example that would ask for a word and it would tell you the text suggestions. Thanks, Kevin _____________________________________________________________ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com
--- Karl Putland <karl@putland.linux-site.net> wrote:>eagi-sphinx-test.c has hardcoded values for the sphinx server. Change >the values to suit your network and installation and try again. > >--KarlYup, sorry I forgot to mention that. I have the correct IP and port in there. It was giving me errors before that. I'm just not sure what exactly is supposted to happen with the example. I don't see anything that would resemble speech recognition there except for those return codes but I don't know what significance those numbers would have. Using the sphinx testing applications, it says that you have to press return on the server before it starts the recognition. I see that asterisk connects and it asks for you to press enter. I don't get anything different if I press enter on the server. This doesn't seem right anyways. Is there some kind of other configuration that I need to have it just run in the background and automatically accept the connection and translate? Just was hoping for someone that has dealt with it more and that maybe had a better Sphinx EAGI example that would ask for a word and it would tell you the text suggestions. Thanks, Kevin _____________________________________________________________ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com
Hi, I'm, doing the same, but with a php agi, and invoking a modified script to use sphinx: /usr/local/bin/decoder2 #!/bin/sh BASE=6403 S2BATCH=sphinx2-continuous HMM=/usr/local/share/sphinx2/model/hmm/6k TASK=/usr/local/share/sphinx2/model/lm/${BASE} CTLFILE=/usr/local/share/sphinx2/model/lm/${BASE}/${BASE}.ctl #BASE=$1 $S2BATCH -nbest 1 -nbestdir /tmp -verbose 0 -adcin TRUE -adcext wav -ctlfn ${CTLFILE} -ctloffset 0 -ctlcount 100000000 -datadir ${TASK} -samp 8000 -agcmax TRUE -langwt 6.5 -fwdflatlw 8.5 -rescorelw 9.5 -ugwt 0.5 -fillpen 1e-10 -silpen 0.005 -inspen 0.65 -top 1 -topsenfrm 3 -topsenthresh -70000 -beam 2e-06 -npbeam 2e-06 -lpbeam 2e-05 -lponlybeam 0.0005 -nwbeam 0.0005 -fwdflat FALSE -fwdflatbeam 1e-08 -fwdflatnwbeam 0.0003 -bestpath TRUE -kbdumpdir ${TASK} -lmfn ${TASK}/${BASE}.lm -dictfn ${TASK}/${BASE}.dic -noisedict ${HMM}/noisedict -phnfn ${HMM}/phone -mapfn ${HMM}/map -hmmdir ${HMM} -hmmdirlist ${HMM} -8bsen TRUE -sendumpfn ${HMM}/sendump -cbdir ${HMM} My php-test.agi: function __write__($line) { print $line."\n"; } function __read__() { global $in; $input=str_replace("\n","",fgets($in,4096)); return $input; } function festival($texto) { __write__("EXEC FESTIVAL \"$texto\""); return __read__(); } function record($filename, $digits) { __write__("RECORD FILE $filename wav $digits 15000 BEEP"); return __read__(); } $in=fopen("php://stdin","r"); festival("ingrese su mensaje"); record("mensaje","#"); $comando="/usr/local/bin/decoder2"; $value=file("/tmp/mensaje.hyp"); $value=$value[0]; $numero=trim(substr($value,strpos($value,">")+1)); if($numero!="") festival("usted a seleccionado el numero $numero"); exec($comando); El Jueves 18 Diciembre 2003 17:40, Kevin Bockman escribi?:> Hi. I just started trying to play with Sphinx. I followed their site as > far as running sphinx-server. It is listening on the default port. I > copied sphinx2-simple to another file and changed sphinx2-continuous to > sphinx2-server. > > So, I ran eagi-sphinx-test under asterisk. What exactly is it supposted to > do? Here's what I get: > > debian:~# sphinx2-simple2 > > sphinx2-simple: > Demo CMU Sphinx2 decoder called with command line arguments. > > <executing /usr/local/bin/sphinx2-server, please wait> > ioctl(SETDUPLEX) failed: Invalid argument > Calibrating background noise level...done > server.c(443): Bad or missing port# argument, using 7027 > srvcore.c(382): Listening at port 7027 > srvcore.c(409): Connected >>>>>>>> 192.168.1.99 at Thu Dec 18 15:24:19 2003 > > Hit <CR> to start listening, q<CR> to quit client connection > > -- Executing Answer("SIP/test-ff55", "") in new stack > -- Executing EAGI("SIP/test-ff55", "eagi-sphinx-test") in new stack > -- Launched AGI Script /var/lib/asterisk/agi-bin/eagi-sphinx-test > Environment: 'agi_request' is 'eagi-sphinx-test' > Environment: 'agi_channel' is 'SIP/test-ff55' > Environment: 'agi_language' is 'en' > Environment: 'agi_type' is 'sip' > Environment: 'agi_uniqueid' is '1071786651.21' > Environment: 'agi_callerid' is '"blah" <1234>' > Environment: 'agi_dnid' is 'unknown' > Environment: 'agi_rdnis' is 'unknown' > Environment: 'agi_context' is 'default' > Environment: 'agi_extension' is '911' > Environment: 'agi_priority' is '2' > Environment: 'agi_enhanced' is '1.0' > Environment: 'agi_accountcode' is '' > Ooh, got a response from Asterisk: '200 result=0 endpos=46560' > 1. Result is '200 result=0 endpos=46560' > Ooh, got a response from Asterisk: '200 result=0 endpos=30720' > 2. Result is '200 result=0 endpos=30720' > -- Playing 'digits/20' (language 'en') > -- Playing 'digits/3' (language 'en') > -- Playing 'digits/million' (language 'en') > -- Playing 'digits/4' (language 'en') > -- Playing 'digits/hundred' (language 'en') > -- Playing 'digits/50' (language 'en') > -- Playing 'digits/2' (language 'en') > -- Playing 'digits/thousand' (language 'en') > -- Playing 'digits/3' (language 'en') > -- Playing 'digits/hundred' (language 'en') > -- Playing 'digits/40' (language 'en') > -- Playing 'digits/5' (language 'en') > Ooh, got a response from Asterisk: '200 result=0' > 3. Result is '200 result=0' > -- Playing 'demo-enterkeywords' (language 'en') > Ooh, got a response from Asterisk: '200 result= (timeout)' > 4. Result is '200 result= (timeout)' > Ooh, got a response from Asterisk: '200 result=0 endpos=9440' > 5. Result is '200 result=0 endpos=9440' > -- AGI Script eagi-sphinx-test completed, returning 0 > > Is the endpos number something significant? What is it referring to? > > Am I doing this right? > > Does anyone have any other EAGI Sphinx examples? Maybe something that asks > for you to say a word and it puts it into text? > > Sorry, this is pretty neat but there's hardly any information on it. I've > tried searching the lists and I see a couple people that have used it but > that's all. > > Thanks, > > Kevin B. > > _____________________________________________________________ > Are you a Techie? Get Your Free Tech Email Address Now! Visit > http://www.TechEmail.com _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users
--- Mauricio Nu?ez <mauricio@chile.com> wrote:>/usr/local/bin/decoder2 >#!/bin/sh >BASE=6403I changed this to BASE=turtle>$S2BATCH -nbest 1 -nbestdir /tmp -verbose 0 -adcin TRUE -adcext wav ->ctlfn >${CTLFILE} -ctloffset 0 -ctlcount 100000000 -datadir ${TASK} -samp >8000 >-agcmax TRUE -langwt 6.5 -fwdflatlw 8.5 -rescorelw 9.5 -ugwt 0.5 ->fillpen >1e-10 -silpen 0.005 -inspen 0.65 -top 1 -topsenfrm 3 -topsenthresh ->70000 >-beam 2e-06 -npbeam 2e-06 -lpbeam 2e-05 -lponlybeam 0.0005 -nwbeam >0.0005 >-fwdflat FALSE -fwdflatbeam 1e-08 -fwdflatnwbeam 0.0003 -bestpath TRUE >-kbdumpdir ${TASK} -lmfn ${TASK}/${BASE}.lm -dictfn ${TASK}/${BASE}.dic >-noisedict ${HMM}/noisedict -phnfn ${HMM}/phone -mapfn ${HMM}/map ->hmmdir >${HMM} -hmmdirlist ${HMM} -8bsen TRUE -sendumpfn ${HMM}/sendump -cbdir >${HMM}I put all of this on one line>My php-test.agi: >festival("ingrese su mensaje");Festival was saying the text, but giving me an RTP read error. I commented it out and now it does not.>record("mensaje","#");I changed this to /tmp/mensaje. Not sure where it would have recorded it otherwise. I did a find on mensaje.wav but it did not find it anywhere until I changed it to /tmp>$value=file("/tmp/mensaje.hyp");I'm not seeing this file. It makes /tmp/goforward.hyp with the folowing: debian:/tmp# more goforward.hyp <s> YOU WHAT TWO ARE YOU ARE (I never said anything)>$value=$value[0]; >$numero=trim(substr($value,strpos($value,">")+1)); >if($numero!="") > festival("usted a seleccionado el numero $numero"); >exec($comando);What I'm not sure about is why you are checking the value before running sphinx. This would be getting a previous value correct? Also, I'm not sure how sphinx is getting the file /tmp/mensaje.wav. This is the big thing that I'm missing. The script runs for me, festival says the text (when I had it uncommented), gave a beep, recorded the file, then quit. There was the .wav file and goforward.hyp in /tmp. Once I understand how sphinx gets the output, I think I will have it figured out if you could help me with that. I don't understand how sphinx knows the output file (from the .wav) to decode it. I appreciate your input and help very much. This is exactly what I was looking for. Thanks, Kevin _____________________________________________________________ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com
Hi, --- Mauricio Nu?ez <mauricio@chile.com> wrote:>Inside ${BASE}, i had a control file ${BASE}.ctl, with the line: > >/var/lib/asterisk/sounds/mensaje > >hardcoded.Ok, got that.>To work with asterisk, i put the -sample option at 8000 , because that >is the wav sampling. The turtle example work at 16000, and that's >explain because you get a strange result.Got that.>I'm executing wrongly the command ? I' will check that. I'm trying to >get asterisk work with sphinx from yesterday :-), but almost is >working (slow, but working)It complains that the wav file does not exist the first time it runs. I had to quickly patch things together to restart it. Getting ready to head out to school and get groceries. I will look further into that part. Have to get a microphone to test it further. It outputs <s> A now which should be good. The next big problem I see is that every time you run the script, it uses the same file. This will need to be modified to be a unique filename for each caller/iteration. You are doing very well for your second day with Sphinx. A lot better than me. Hopefully between the two of us, we can get that problem fixed. It's a step in the right direction. Thanks, Kevin _____________________________________________________________ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com
Is anyone doing anything useful with Sphinx? There is a small amount of info on the wiki to help with implementing it but I'm curious if anyone is actually using it. Barry -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050103/db176416/attachment.htm
What is it? Besides a statue in a dusty part of Egypt. Brian Greul Texas Shirt Company www.txshirts.com 713-802-0369 / 713-861-6261 (fax) _____ From: Barry Porch [mailto:bporch@watsonconnects.com] Sent: Monday, January 03, 2005 2:05 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Sphinx Is anyone doing anything useful with Sphinx? There is a small amount of info on the wiki to help with implementing it but I'm curious if anyone is actually using it. Barry -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050103/b2a8497e/attachment.htm
On Mon, 2005-01-03 at 14:22 -0600, brian@txshirts.com wrote:> What is it? Besides a statue in a dusty part of Egypt.A very good example of when you should turn to google and ask the question. With about the same amount of effort as asking here you could have found out it is speech recognition software from CMU. Also TURN OFF HTML in your email.> > ______________________________________________________________________ > From: Barry Porch [mailto:bporch@watsonconnects.com] > Sent: Monday, January 03, 2005 2:05 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] Sphinx > > > > Is anyone doing anything useful with Sphinx? > > > > There is a small amount of info on the wiki to help with implementing > it but I?m curious if anyone is actually using it.-- Steven Critchfield <critch@basesys.com>
Ok, anyone used Sphinx with Asterisk? The docs are great at telling me how the internals of the damn thing work, but now how to USE it. I can't find a single example of how to run 'decode' in command line mode, without specifying a billion options! Doug.