Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: "William DePalo [MVP VC++]" <willd.no.spam@xxxxxxxx>
- Date: Mon, 26 Sep 2005 16:38:26 -0400
"Jack" <replyto@newsgroup> wrote in message
news:e784gWswFHA.2924@xxxxxxxxxxxxxxxxxxxxxxx
> Will, please read few posts before.
I have. All of them.
> Before, close to the beginning of that thread you stated you CAN receive
> Tapi messages DURING the play.
Yes. I can and I do. Even while VB6 applications are running in my server.
> Now, you say something different.
No. You don't understand and you don't listen.
> You contradict yourself.
Nope. The behavior you see is to be expected _if_ you proceed synchronously.
Do you know what that means?
To synchronously speak or stream means that the stretch of code that speaks
text or that streams a media file does nothing else but the speaking or the
streaming while either is ongoing. How can you possibly hope to receive a
notification in that case?
As Matthias and I have been trying to tell you THAT IS YOUR PROBLEM.
I said I can a do receive messages ( especially the all important state
messages that report disconnection ) because I do _nothing_ synchronously.
In other words, after commanding SAPI to speak or beginning an audio stream
my server runs code that listens for the next event.
Are you a VB "developer"? Are you familiar with the DoEvents method? Do you
know what happens if you fail to call it when you must in a windowed
application? When Windows messages /events fail to be processed the user
perceives the application as hung, yes?
The same is true here. The difference is that we are not discussing Windows
messages per se but rather TAPI, SAPI and waveform audio messages.
And just so there is no confusion, I am not saying that DoEvents is the fix.
I am saying that processing event notification while streaming or speaking
is ongoing is the fix. For the record, I don't know and don't care to know
how to make that fix in VB.
Finally, as you appear not to heed advice from Matthias or me, take a look
at this caution from the Simple Telephony sample of the Speech SDK
<quote>
// NOTE: The call-handling sequence in this application is
// short, so it is fine to make it all the way through to
// the end of the call even if the caller hung up in the
// middle. If your telephony app involves a lengthy
// call-handling sequence, you need a separate thread to
// listen for TAPI's CS_DISCONNECT message; otherwise your
// app will have no way of being notified of the hang-up,
// and your app will appear to have hung.
</quote>
You can look at the streaming of a media file or the synthesization of text
as one of the "lengthy call-handling sequence"s that the author is talking
about. You can take the delay in receiving the disconnect message as "appear
to have hung". The author of that caution is suggesting that handling events
in a background thread is the fix to the problem caused by applications that
use a naive single-threaded approach.
Regards,
Will
.
- References:
- When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Jack
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Jack
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Matthias Moetje
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Jack
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Matthias Moetje
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Jack
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: William DePalo [MVP VC++]
- Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- From: Jack
- When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- Prev by Date: Re: What does your PBX signal when you pickup a phone handset?
- Next by Date: Re: No consigo grabar el sonido de mi modem con tapi
- Previous by thread: Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- Next by thread: Re: When using Ms Speech Engine Tapi CALLBACK stops receiving TAPI events!!!!
- Index(es):
Relevant Pages
|