PromptBuilder..::..AppendAudio Method (Uri, String) |
PromptBuilder Class Example See Also Send Feedback |
Appends the specified audio file and alternate text to the PromptBuilder.
Namespace:
Microsoft.Speech.Synthesis
Assembly:
Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub AppendAudio ( _ audioFile As Uri, _ alternateText As String _ ) |
Visual Basic (Usage) |
---|
Dim instance As PromptBuilder Dim audioFile As Uri Dim alternateText As String instance.AppendAudio(audioFile, alternateText) |
C# |
---|
public void AppendAudio( Uri audioFile, string alternateText ) |
Parameters
- audioFile
- Type: System..::..Uri
URI for the audio file.
- alternateText
- Type: System..::..String
A string containing alternate text representing the audio.
Remarks
The audio file can be in WMA format provided that both of the following conditions are met.
The WMA codec is available.
The target operating system has the appropriate Windows features installed or enabled.
A computer running Microsoft Windows Server 2003 x64 Editions must have Windows Media Format 9.5 Software Development Kit (SDK) x64 Edition installed.
A computer running Microsoft Windows Server 2008 or Windows Server 2008 R2 must have the Desktop Experience feature installed, as described in the following procedure.
Windows Vista and Windows 7 already have the Desktop Experience feature enabled automatically.
To install the Desktop Experience feature (Windows Server 2008, Windows Server 2008 R2)
On the Start menu, click Server Management.
In the Server Management dialog box, in the Features Summary pane, click Add Features.
In the Select Features dialog box, select the Desktop Experience check box, and then click Install.
Examples
The following examples adds an audio file to a PromptBuilder instance and specifies text to speak if the audio file cannot be played.
Copy Code | |
---|---|
using Microsoft.Speech.PromptBuilder; public void SimpleConcatenation() { // Concatenate a prompt fragment from a .wav file. PromptBuilder builder = new PromptBuilder (); builder.AppendAudio(new Uri ("C:\\OnHold.wav"), "Your call will be answered in the order it was received"); } |
The following markup shows the equivalent SSML markup.
Copy Code | |
---|---|
<speak xmlns="http://www.w3.org/2001/10/synthesis" xmlns:ms="http://www.microsoft.com/speech/synthesis" xml:lang="en"> <audio src="C:\OnHold.wav"> Your call will be answered in the order it was received. </audio> </speak> |