Developer .NET UPDATE—brought to you by the Windows & .NET Magazine Network
THIS ISSUE SPONSORED BY
Microsoft ASP.NET Connections & Visual Studio Connections
DevConnections Events and Windows & .NET Magazine Network
(below DEVELOPER .NET PERSPECTIVES)
SPONSOR: MICROSOFT ASP.NET CONNECTIONS & VISUAL STUDIO CONNECTIONS
Microsoft ASP.NET Connections + Visual Studio Connections + SQL Server Magazine Connections equals the largest gathering of Microsoft product architects and independent IT gurus, delivering four days of hard-core drill-down sessions that you will not find anywhere else. The Microsoft product team delivers over 35 cutting-edge sessions on the latest product releases. In addition, you can choose from over 100 in-depth sessions presented by our world-class speakers, authors, and consultants who share real-world solutions that will save you months of trial and error. Visit our expo hall to see the latest technology and have a chance to win a Harley Davidson among other cool give-always. After an intense day of sessions unwind at events like "Microsoft Unplugged," where no question is out of line or march in the Mardi Gras Parade to the House of Blues for a night to remember. Register early and get three power-packed events for the price of one. May 6-9, 2003, at the Hilton Riverside New Orleans. For more details, call 800-438-6720 or visit our Web site at
January 14, 2003—In this issue:
1. DEVELOPER .NET PERSPECTIVES
- Now We're Talking, Part 2
- New! News, Tips, and More to Keep Your Network Humming
- SSMU Web Seminar Instructors Make the Difference!
- Back by Popular Demand—Don't Miss Our Security Road Show Event!
- Learn About the CLR
4. NEW AND IMPROVED
- Add Enhanced Email Functionality to Your Applications
5. CONTACT US
- See this section for a list of ways to contact us.
1. DEVELOPER .NET PERSPECTIVES
(contributed by Marquis Howard, [email protected])
Last week, I introduced you to the Microsoft .NET Speech software development kit (SDK) beta 2 and provided a general overview of the underlying speech technologies. This week, I want to step you through a sample application and identify some controls, along with the properties that aid the Text-to-Speech (TTS) synthesis process.
Before I dive into the code that makes a Web page speak, let's look at the control you're going to use. The Question/Answer (QA) control is one of the main ASP.NET speech controls. The QA control consists of several objects, including the Prompt object, which I focus on this week.
The Prompt object performs several functions in a speech application. Prompt objects provide the prompts that greet users when they first come to the Web page. A prompt can be a voice guide that gives users instructional information about what to do in the application. A prompt can also ask questions pertaining to the application.
A Prompt object can be either TTS driven or .wav file driven. TTS output is a computerized voice. If the text source is dynamic (e.g., text that's assembled at runtime), using TTS is the way to go. However, if you have an application for which you know all the prompts, you might consider using prerecorded prompts that consist of .wav files. The .NET Speech SDK installs a tool in Visual Studio .NET that lets you build prerecorded prompts as a separate project called a Prompt Database. Inside your current project from the File menu, click Add New Project, select the Prompt project, then click the Prompt template. The SDK includes a tutorial about how to create prompt databases. Because this process is detailed, I recommend that you read the Help text for a better understanding.
Last week, you started to create a sample multimodal application. This type of application lets the client interact by way of mouse clicks or by speaking through a microphone. Suppose that the sample application is a movie preview Web site. You plan to update the Web site's welcome message, along with the movie list, every week. A Web service will provide the message and movie list. Users will be able to manually select the movie they want to preview or verbally choose the desired movie from the list.
To ensure that we're all on the same page, let's start with customizing this application. First, you need to add an ASP.NET ListBox control on the Web form. This control will contain the list of movies from which the user will choose. You also need to place two Label controls on the Web form. One Label control (Label1) will contain the greeting text that will come from the Web service. The other Label control (Label2) will contain text that instructs the user to choose which movie he or she wants to preview.
Next, you need to get the application to prompt the user for input. To do so, place a QA control on the Web form. You can find the QA control by clicking the Speech option in your toolbox.
After you add the control to the form, you can begin customizing the properties. To help you set the property values for the QA control and other controls, Visual Studio .NET provides the QA Property Builder. The builder is a great tool that can help you become more familiar with the control with which you're working. After setting properties inside the QA Property Builder, you can switch to the HTML view of your Web form to view the code it generates for you. For example, right-click the QA control, select QA Property Builder from the list, and set the ID of the control to welcomeQA. Close the builder, then select the HTML tab to view the code that the builder generated in your Web page. Although you can write the code yourself, using the QA Property Builder speeds up development time quite a bit.
In the code behind the Web page, you now need to add code to the form's Load method. First, create an instance of the Web service and local variables. Next, set Label1's text property to the response that the Web service returns. Finally, set the QA control's InlinePrompt property to the same value as the Label1 text property; this value will be the welcome prompt. Note that the InlinePrompt property accepts text as well as XML markup. Your code changes should result in a load event handler similar to this one:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Call the Web service to retrieve the welcome message. Dim WebSvrc As New webservice1.clsPrompts Dim sGreeting As String sGreeting = objWebSvrc.getGreeting Label1.Text = sGreeting welcomeQA.Prompt.InlinePrompt = Label1.Text End Sub
If you don't have a Web service, you can replace the call to the Web service with a static string, such as "Select a movie from the list of available movies."
From Visual Studio .NET, click Run to start the project. After the browser is open, you need to add a query-string parameter to the URL. The parameter to add is "?mode=voiceonly" so that your URL looks similar to http://localhost/SpeechTest?Webform1.aspx?mode=voiceonly. Requesting the Web page with this URL triggers the voice prompts for multimodal applications. You don't need to add this query-string parameter in voice-only applications.
If you want to make the application voice-only, you must change the project's property. To do so, right-click the project name in Solution Explorer and select Properties. In the Command Line Arguments section in the Properties dialog box, type "mode=voiceonly" and click OK. Now when you start your application from Visual Studio .NET by clicking the Run, the browser will immediately start reading your Web page. Next week, I'll show you how to add the code that lets you talk to the application.
SPONSOR: DEVCONNECTIONS EVENTS AND WINDOWS & .NET MAGAZINE NETWORK
FREE SUBSCRIPTION TO EVENTS INSIGHT
Now you can receive timely information about technical education conferences and seminars from DevConnections Events and Windows & .NET Magazine Network. Stay up to date on the latest details about Microsoft ASP.NET Connections, Visual Studio .NET Connections, SQL Server Magazine LIVE!, Windows & .NET Magazine LIVE!, and XML Web Services Connections. Subscribe for FREE by sending a blank email to:
(brought to you by Windows & .NET Magazine and its partners)
Networking UPDATE brings you the how-to tips and news you need to implement and maintain a rock-solid networking infrastructure. We'll explore interoperability solutions, hardware (including servers, routers, and switches), network architecture, network management, network security, installation technology, network training, and WAN disaster recovery. Subscribe (at no cost!) at
SQL Server Magazine University (SSMU) Web Seminar instructors are tried and true people you've come to know and trust through their articles and insights published in SQL Server Magazine. Finally, online training led by SQL Server gurus with real-life business application experience, not just theory! Get complete course info at
If you missed last year's popular security road show event, now's your chance to catch it again in Portland, Oregon, and Redmond. Learn from experts Mark Minasi and Paul Thurrott about how to shore up your system's security and what desktop security features are planned for .NET and beyond. Registration is free so sign up now!
If you have hard water, the acronym CLR might conjure up the image of the product that removes calcium, lime, and rust deposits. However, the acronym CLR also refers to the Common Language Runtime, a fundamental part of the Microsoft .NET Framework. To learn about the role that the CLR plays in the .NET Framework, go to
4. NEW AND IMPROVED
(contributed by Sue Cooper, [email protected])
ExclamationSoft announced Smtp.NET 2.0, a tool that extends the basic functionality of Microsoft .NET email libraries. You can specify multiple mail servers for failover and redundancy, and add authentication to your ASP.NET and WinForms applications. Other features include built-in database functionality, HTML and plain-text capabilities, and rich-message formatting. Smtp.NET 2.0 supports Windows OSs with the .NET Framework installed. Pricing starts at $99.95 for a single-user license. Contact ExclamationSoft at 215-489-0111, 866-489-0111, or [email protected]
5. CONTACT US
Here's how to reach us with your comments and questions:
- ABOUT DEVELOPER .NET PERSPECTIVES — [email protected]
- ABOUT THE NEWSLETTER IN GENERAL — [email protected]
(please mention the newsletter name in the subject line)
- TECHNICAL QUESTIONS — http://www.winnetmag.net/forums
- PRODUCT NEWS — [email protected]
- QUESTIONS ABOUT YOUR DEVELOPER .NET UPDATE SUBSCRIPTION?
Customer Support — [email protected]
- WANT TO SPONSOR DEVELOPER .NET UPDATE?
This weekly email newsletter is brought to you by Windows & .NET Magazine, the leading publication for Windows professionals who want to learn more and perform better. Subscribe today.
Receive the latest information about the Windows and .NET topics of your choice. Subscribe to our other FREE email newsletters.