<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I started to test the integration of my speech recognizer but not
everything is going as expected....<br>
<br>
- Is ast_speech_engine-&gt;start supposed to be a synchronous function?<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,1,Answer()<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,n,SpeechCreate(Audimus)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,n,SpeechActivateGrammar(digitos-unidades)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,n,SpeechStart()<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,n,Background(hello-world)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,n,SpeechDeactivateGrammar(digitos-unidades)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exten =&gt; 1000,n,Goto(internal-${SPEECH_TEXT(0)})<br>
<br>
&nbsp;I have the above dialpan (copied from docs) and what is happening is:<br>
&nbsp;&nbsp;&nbsp; -- Executing [1000@phones:1] Answer("SIP/1000-0334ea70", "") in new
stack<br>
&nbsp;&nbsp;&nbsp; -- Executing [1000@phones:2] SpeechCreate("SIP/1000-0334ea70",
"Audimus") in new stack<br>
&nbsp;&nbsp;&nbsp; -- Executing [1000@phones:3]
SpeechActivateGrammar("SIP/1000-0334ea70", "digitos-unidades") in new
stack<br>
&nbsp;&nbsp;&nbsp; -- Executing [1000@phones:4] SpeechStart("SIP/1000-0334ea70", "")
in new stack<br>
&nbsp;&nbsp;&nbsp; -- Executing [1000@phones:5] BackGround("SIP/1000-0334ea70",
"hello-world") in new stack<br>
&nbsp;&nbsp;&nbsp; -- &lt;SIP/1000-0334ea70&gt; Playing 'hello-world' (language 'en')<br>
&nbsp;&nbsp;&nbsp; -- Executing [1000@phones:6] <b>SpeechDeactivateGrammar</b>("SIP/1000-0334ea70",
"digitos-unidades") in new stack<br>
<br>
&nbsp;There is no wait explicit wait for engine results and there's no call
to ast_speech_engine-&gt;write (no audio is being sent to the ASR).<br>
<br>
&nbsp;From the functions in ast_speech_engine which of them should be
synchronous?<br>
&nbsp;How is ast_speech-&gt;state affecting the Asterisk behavior? (if you
indicate me the source file, I can check it myself)<br>
&nbsp;What else should be done do to have audio streamed to my engine?<br>
<br>
Renato<br>
<br>
<br>
Joshua Colp wrote:
<blockquote
 cite="mid:30395120.454721232386752893.JavaMail.root@jupiler.digium.com"
 type="cite">
  <pre wrap="">----- "Renato Cassaca" wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">I'm finishing the ASR integration and I have a few more questions
(hopefully, the last ones):
- ast_speech_engine-&gt;get(...): returns the next available result or
all pending available results?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
It returns a linked list of results sorted by score.
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">- ast_speech_engine-&gt;dtmf(...): what is the expected engine behavior?
- stop the recognition, ignoring the results that are being processed
(but not finalized yet)
- stop the recognition but produce all results that are being
processed (and can be finalized with the received audio)
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This callback is purely informational. You do not need to implement it.
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">- ast_speech_engine-&gt;list: it's managed by Asterisk, I don't have to
do nothing with it. Right?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Right.
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">- ast_speech_engine-&gt;activate(...grammar...): the activated grammar is
exclusive or incremental?
That means, if the ASR has already an activated grammar, should the
new one be added to them or should all current ASR grammars be
replaced by the new one? The interpretation of this will influence the
implementation of deactivate...
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This depends on the engine itself... you can implement it whichever way you want. I would say have it so that you can have multiple grammars at once though. This is what people would probably expect. 

  </pre>
</blockquote>
</body>
</html>