AppendAudio Method (Uri)
Collapse the table of content
Expand the table of content

PromptBuilder.AppendAudio Method (Uri)

 

Appends the audio file at the specified URI to the PromptBuilder.

Namespace:   System.Speech.Synthesis
Assembly:  System.Speech (in System.Speech.dll)

public void AppendAudio(
	Uri audioFile
)

Parameters

audioFile
Type: System.Uri

URI for the audio file.

The following example initializes a new instance of the PromptBuilder class and then adds text to it, followed by an audio file.

using System.Speech.PromptBuilder;

public void SimpleConcatenation()
{
    // Add a prompt fragment from a .wav file.
    PromptBuilder builder = new PromptBuilder ();
    builder.AppendText("How are you today?");
    builder.AppendAudio(new Uri ("http://www.speech.microsoft.com/ding.wav"));
}

The following markup shows the equivalent SSML markup.

<speak xmlns="http://www.w3.org/2001/10/synthesis"
       xmlns:ms="http://www.microsoft.com/speech/synthesis" xml:lang="en">

  How are you today?
  <audio src="http://www.speech.microsoft.com/ding.wav" />

</speak>

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft