Joshua,<br><br>Thanks for your insight. <br><br>I started looking at your app_speech_utils.c and wanted to use it as base code to customize as my first version of nuance decoder just takes a file and outputs the result. <br>
<br>After looking at the code and making first attempt, I then realized that its much easier to add the connector module rather than customizing speechbackground as it relies on so many things. Speech_create etc.<br><br>
I made a dummy module which just prints the status of each callback. Here is the trace.<br><br><br> -- Executing [3010@default:1] SpeechCreate("SIP/station1-08ce3998", "nuance") in new stack<br>[May 19 18:27:17] WARNING[8638]: app_mc.c:94 create: Creating Speech Engine [May 19 18:27:17] WARNING[8638]: app_mc.c:96 create: nuance<br>
-- Executing [3010@default:2] SpeechActivateGrammar("SIP/station1-08ce3998", "company-directory") in new stack<br>[May 19 18:27:17] WARNING[8638]: app_mc.c:137 activate: Activating Grammar Name [May 19 18:27:17] WARNING[8638]: app_mc.c:139 activate: nuance company-directory<br>
-- Executing [3010@default:3] SpeechStart("SIP/station1-08ce3998", "") in new stack<br>[May 19 18:27:17] WARNING[8638]: app_mc.c:163 start: Starting Engine [May 19 18:27:17] WARNING[8638]: app_mc.c:165 start: nuance<br>
-- Executing [3010@default:4] SpeechBackground("SIP/station1-08ce3998", "AppointmentTomorrow") in new stack<br>[May 19 18:27:17] WARNING[8638]: app_mc.c:163 start: Starting Engine [May 19 18:27:17] WARNING[8638]: app_mc.c:165 start: nuance<br>
[May 19 18:27:17] WARNING[8638]: format_wav.c:156 check_header: Unexpected freqency 16000<br>[May 19 18:27:17] WARNING[8638]: file.c:316 fn_wrapper: Unable to open format wav<br> -- Saved useragent "SJphone/1.65.377a (SJ Labs)" for peer station1<br>
[May 19 18:28:00] WARNING[8638]: app_mc.c:105 destroy: Destroying Speech Engine [May 19 18:28:00] WARNING[8638]: app_mc.c:107 destroy: nuance<br> --<br><br><br>I saw two problems and few questions. SpeechStart is called twice. It is also called from SpeechBackground. I am not sure why is it being called. <br>
<br><br>int start(struct ast_speech *speech)<br> {<br> ast_log(LOG_WARNING, "Starting Engine ");<br> if(speech != NULL && speech->engine != NULL )<br> ast_log(LOG_WARNING, "%s\n", speech->engine->name);<br>
<br> return 0;<br> }<br><br><br>Write callback is never called. I see that in your speech_utils code that you write to engine only when AST_SPEECH_STATE_READY is set. When is the right time to set this? Should we set it in speechcreate? Which function call is the right way? I cannot use change callback as it will in turn call me again.<br>
<br>I thought the internal engine should call this when it detects that the caller has started talking and then does it automatically.<br><br>if (ast_test_flag(speech, AST_SPEECH_QUIET)) ;; Who sets this flag? Does your underlying dsp engine in asterisk processes and sets it or is the connector module incharge to detect using its own algorithm and then set it? I hope its the dsp engine. The reason I ask you is because the speech didn't stop in my case at all.<br>
<br>I'm getting there. Thanks Joshua.<br><br><br><div class="gmail_quote">On Thu, May 15, 2008 at 9:44 PM, Joshua Colp <<a href="mailto:jcolp@digium.com">jcolp@digium.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">----- "praveen kumar" <<a href="mailto:pbx.kumar@gmail.com">pbx.kumar@gmail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> Kudos to the asterisk community.<br>
><br>
<br>
</div>Greetings and salutations.<br>
<div class="Ih2E3d"><br>
> - the present solution has a big drawback. The users have to wait till<br>
> the end of the prompt before they can start recording. They cannot<br>
> speak in between and this is causing a problem. Is there a way to stop<br>
> playback of prompt when the speech is detected from the callee end.<br>
><br>
<br>
</div>There's nothing really built in to do speaker detection in this instance and stop it.<br>
<div class="Ih2E3d"><br>
> - I see that speech api is available and connectors can be written but<br>
> there is no proper documentation. Can we check how lumenvox has done<br>
> the connector? Since its GPL licensed - I am assuming it should be<br>
> shared.<br>
<br>
</div>The Lumenvox connector is a binary module and is not under a GPL license. The source is therefore not available. As for documentation for the API it is correct there is no example connector module but the API is intuitive enough that you should be able to figure it out if you are a developer.<br>
<br>
You create an ast_speech_engine structure with callbacks to everything that your engine can handle. Create/destroy callbacks exist for when a speech object is created and destroyed. Load/unload/activate/deactivate callbacks exist for grammars. The start callback is called when res_speech is going to start feeding audio into your engine. The write callback gets called with audio that be fed into your engine. The get callback is called when res_speech wants to get results of the code. It is up to your engine to set flags on the speech object to indicate various things. AST_SPEECH_QUIET signals that the person is speaking and AST_SPEECH_HAVE_RESULTS signals that your engine has results from the decode.<br>
<br>
This is a rough view of things.<br>
<div class="Ih2E3d"><br>
> - backgrounddetect does stop during play but it jumps to talk<br>
> extension. we want the entire speech to be recorded and leaving out<br>
> the first fragment which triggered to jump to talk extension will not<br>
> server the purpose in speech detection. further, since its agi , its<br>
> not extension driven.<br>
><br>
<br>
</div>If you want to approach it this way you will need to do some custom coding.<br>
<br>
Joshua Colp<br>
Software Developer<br>
Digium, Inc.<br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank">http://www.api-digital.com--</a><br>
<br>
asterisk-speech-rec mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-speech-rec" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-speech-rec</a><br>
</blockquote></div><br>