PromptBuilder.AppendSsml 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
개체에 SSML 파일을 PromptBuilder 추가합니다.
오버로드
| Name | Description |
|---|---|
| AppendSsml(String) |
개체의 지정된 경로 PromptBuilder 에 SSML 파일을 추가합니다. |
| AppendSsml(Uri) |
지정된 URI의 SSML 파일을 개체에 PromptBuilder 추가합니다. |
| AppendSsml(XmlReader) |
SSML 프롬프트를 참조하는 개체를 개체에 |
AppendSsml(String)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
개체의 지정된 경로 PromptBuilder 에 SSML 파일을 추가합니다.
public:
void AppendSsml(System::String ^ path);
public void AppendSsml(string path);
member this.AppendSsml : string -> unit
Public Sub AppendSsml (path As String)
매개 변수
- path
- String
추가할 SSML 파일의 정규화된 경로입니다.
예제
다음 예제에서는 개체를 PromptBuilder 만들고 메서드를 사용하여 AppendSsml SSML 파일의 내용을 추가합니다.
using System;
using System.Speech.Synthesis;
namespace SampleSynthesis
{
class Program
{
static void Main(string[] args)
{
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Configure the audio output.
synth.SetOutputToDefaultAudioDevice();
// Create a PromptBuilder object and append a file that defines an SSML prompt.
PromptBuilder ssmlFile = new PromptBuilder();
ssmlFile.AppendSsml("c:\\test\\Weather.ssml");
// Speak the contents of the SSML prompt.
synth.Speak(ssmlFile);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
다음은 앞의 예제에서 참조하는 SSML 파일입니다.
<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.0"
xmlns="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
<s> The weather forecast for today is partly cloudy with some sun breaks. </s>
</speak>
설명
SSML 파일은 SSML(Speech Synthesis Markup Language) 버전 1.0 사양을 준수하는 XML 형식 파일이어야 합니다.
을 사용하여 AppendSsmlMarkupSSML 태그를 문자열로 추가할 수도 있습니다.
적용 대상
AppendSsml(Uri)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
지정된 URI의 SSML 파일을 개체에 PromptBuilder 추가합니다.
public:
void AppendSsml(Uri ^ ssmlFile);
public void AppendSsml(Uri ssmlFile);
member this.AppendSsml : Uri -> unit
Public Sub AppendSsml (ssmlFile As Uri)
매개 변수
- ssmlFile
- Uri
추가할 SSML 파일에 대한 정규화된 URI입니다.
예제
다음 예제에서는 개체를 PromptBuilder 만들고 메서드를 사용하여 AppendSsml SSML 파일의 내용을 추가합니다.
using System;
using System.Speech.Synthesis;
namespace SampleSynthesis
{
class Program
{
static void Main(string[] args)
{
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Configure the audio output.
synth.SetOutputToDefaultAudioDevice();
// Create a PromptBuilder object and append a file that defines an SSML prompt.
PromptBuilder ssmlFile = new PromptBuilder();
ssmlFile.AppendSsml(new Uri("c:\\test\\Weather.ssml"));
// Speak the contents of the SSML prompt.
synth.Speak(ssmlFile);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
다음은 앞의 예제에서 참조하는 SSML 파일입니다.
<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.0"
xmlns="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
<s> The weather forecast for today is partly cloudy with some sun breaks. </s>
</speak>
설명
SSML 파일은 SSML(Speech Synthesis Markup Language) 버전 1.0 사양을 준수하는 XML 형식 파일이어야 합니다.
을 사용하여 AppendSsmlMarkupSSML 태그를 문자열로 추가할 수도 있습니다.
Important
신뢰할 수 없는 데이터를 사용하여 이 클래스에서 메서드를 호출하는 것은 보안 위험입니다. 신뢰할 수 있는 데이터로만 이 클래스의 메서드를 호출합니다. 자세한 내용은 모든 입력 유효성 검사참조하세요.
적용 대상
AppendSsml(XmlReader)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
SSML 프롬프트를 참조하는 개체를 개체에 XMLReader 추가 PromptBuilder 합니다.
public:
void AppendSsml(System::Xml::XmlReader ^ ssmlFile);
public void AppendSsml(System.Xml.XmlReader ssmlFile);
member this.AppendSsml : System.Xml.XmlReader -> unit
Public Sub AppendSsml (ssmlFile As XmlReader)
매개 변수
- ssmlFile
- XmlReader
추가할 XML 파일에 대한 정규화된 이름입니다.
예제
다음 예제에서는 SSML(Speech Synthesis Markup Language) 태그가 포함된 파일을 참조하는 개체에서 PromptBuilder 개체를 만듭니다XmlReader.
using System;
using System.Xml;
using System.IO;
using System.Speech.Synthesis;
namespace SampleSynthesis
{
class Program
{
static void Main(string[] args)
{
// Initialize a new instance of the SpeechSynthesizer.
using (SpeechSynthesizer synth = new SpeechSynthesizer())
{
// Configure the audio output.
synth.SetOutputToWaveFile(@"C:\test\weather.wav");
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer =
new System.Media.SoundPlayer(@"C:\test\weather.wav");
// Create the path to the SSML file.
string weatherFile = Path.GetFullPath("c:\\test\\Weather.xml");
PromptBuilder builder = null;
// Create an XML Reader from the file, create a PromptBuilder and
// append the XmlReader.
if (File.Exists(weatherFile))
{
XmlReader reader = XmlReader.Create(weatherFile);
builder = new PromptBuilder();
builder.AppendSsml(reader);
reader.Close();
}
// Speak the prompt and play back the output file.
synth.Speak(builder);
m_SoundPlayer.Play();
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
설명
Important
신뢰할 수 없는 데이터와 함께 이 형식의 인스턴스를 사용하는 것은 보안 위험입니다. 신뢰할 수 있는 데이터에서만 이 개체를 사용합니다. 자세한 내용은 모든 입력 유효성 검사참조하세요.
SSML 파일은 SSML(Speech Synthesis Markup Language) 버전 1.0 사양을 준수하는 XML 형식 파일이어야 합니다.
을 사용하여 AppendSsmlMarkupSSML 태그를 문자열로 추가할 수도 있습니다.