[asterisk-speech-rec] New ASR

Joshua Colp jcolp at digium.com
Fri Jan 16 21:51:03 CST 2009


----- "Renato Cassaca" <renato.cassaca at voiceinteraction.pt> wrote:

> Thanks Joshua for your quick answer, it helped me to keep on
> developing. Now I have some calls of Asterisk forwarded to my engine.
> Even though some some quick questions arose:
> 
> - If a call to "speech_engine_create" fails (returns a value different
> from 0) will "speech_engine_destroy" be called to the same ast_speech?

No, it will not be.

> - In ast_speech structure who is responsible to initialize the lock
> and when should it be acquired/release? What is protected by this
> lock?

The ast_speech structure is initialized by res_speech. The only thing you need to initialize is your engine itself. The lock protects the contents of the structure.

> - In ast_speech structure there is a "data" field... What is it for? I
> thought that audio will be delivered to the engine here, but then I
> saw that the write function (in ast_speech_engine) already has an
> argument to that intent...

The field is for data that is unique to your engine. If it has to keep its own structure with current state information, buffers, whatever, it can associate that to the speech session using the data field and then get to it in the various speech callbacks.

-- 
Joshua Colp
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org



More information about the asterisk-speech-rec mailing list