How to: Add a Dynamic Prompt
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Add dynamic prompts in a Speech Server voice response application to, for example, add the result of a run-time SQL query to prompt text.
Adding Dynamic Prompt Text to a Workflow Activity
The following procedure describes how to add dynamic prompt text to a QuestionAnswerActivity class.****You can also use the StatementActivity class in the procedure. This procedure dynamically adds numbered slots to the prompt string. The slot numbering is zero-based, with no upper limit enforced by Speech Server.
To add dynamic prompt text
Create a new voice response application.
For more information, see How to: Create a Voice Response Application.
In Solution Explorer, right-click VoiceResponseWorkflow1.cs, and then select View Designer.
On the View menu, click Toolbox.
In the Toolbox, click Speech Dialog Components to display speech activities.
In the Toolbox, drag and drop a QuestionAnswer speech dialog component onto the design surface.
On the design surface, right-click questionAnswerActivity1, and then click Property Builder.
In the QuestionAnswer Property Builder dialog box, click the Prompts tab, and then type your prompt text in the Main box.
Click Add Slot, and then note the new variable slot in the Main box.
Click Show Event Handler.
Enter code similar to the following example.
// Fill the slots in the prompt, if any are present questionAnswerActivity1.Prompts.MainPrompt.SetText(GetPromptResource(questionAnswerActivity1.Prompts.MainPrompt.Id), "slot0Value");
See Also
Tasks
Walkthrough: Access Dynamic Data