Asynchronous statement? RRS feed

  • Question

  • I have a speech application that receives asynchronous data from another application.


    I would like this data to be spoken as it arrives, independently of the workflow.


    Is this possible?


    I understand it may cause workflow issues if a statement pops up out of nowhere, however I would like to try it out to see how it behaves.

    Friday, July 6, 2007 2:09 PM


  • Do you mean that you want the workflow to be carrying on, doing something, while at the same time (in parallel), you are playing prompts based on some data as it arrives? In theory you could do this. You would need your own event handlers for your "new data arrived" event, and in that handler you add the to-be-played prompt to some queue you've created, and then you poke the queue (play the next thing iff the Synthesizer is currently idle.) You need to also keep track of when the Synthesizer is idle (set a flag when you call SpeakAsync and clear the flag and re-poke the queue when you get the SpeakCompleted event.)


    In practice I'm not sure I understand how this would work from the user's point of view. If you are playing data as it arrives, what is the user doing? Is he responding (speaking/typing DTMF)? If so, you will need to implement your own recognition, using the core-level API, not the workflow API (the workflow API only supports recognition as part of a QuestionAnswer, which means we need to use the Synthesizer; if you've set it playing your own prompt, we will throw an exception.)


    As you can imagine, this seems possible, but messy and tricky. In addition, I'm not sure that using workflow buys you anything if this is really what you want to do. Workflow makes it very easy for you to move sequentially through a dialog flow, and what you're proposing might not fit that model.


    Hope this helps,


    Friday, July 6, 2007 4:43 PM