PromptBuilder.AppendText Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Připojí text k objektu PromptBuilder .
Přetížení
| Name | Description |
|---|---|
| AppendText(String) |
Určuje text, který se má k objektu PromptBuilder připojit. |
| AppendText(String, PromptEmphasis) |
Připojí text k objektu PromptBuilder a určuje stupeň zdůraznění textu. |
| AppendText(String, PromptRate) |
Připojí text k objektu PromptBuilder a určuje míru mluvení textu. |
| AppendText(String, PromptVolume) |
Připojí text k objektu PromptBuilder a určuje svazek pro mluvený text. |
AppendText(String)
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
Určuje text, který se má k objektu PromptBuilder připojit.
public:
void AppendText(System::String ^ textToSpeak);
public void AppendText(string textToSpeak);
member this.AppendText : string -> unit
Public Sub AppendText (textToSpeak As String)
Parametry
- textToSpeak
- String
Řetězec obsahující text, který se má vyslovit.
Příklady
Následující příklad vytvoří PromptBuilder objekt a připojí textový řetězec pomocí AppendText metody.
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 text string.
PromptBuilder speakText = new PromptBuilder();
speakText.AppendText("Say the name of the song you want to hear");
// Speak the contents of the prompt.
synth.Speak(speakText);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
Poznámky
Chcete-li přidat text formátovaný jako jazyk značek SSML, použijte AppendSsmlMarkup.
Platí pro
AppendText(String, PromptEmphasis)
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
Připojí text k objektu PromptBuilder a určuje stupeň zdůraznění textu.
public:
void AppendText(System::String ^ textToSpeak, System::Speech::Synthesis::PromptEmphasis emphasis);
public void AppendText(string textToSpeak, System.Speech.Synthesis.PromptEmphasis emphasis);
member this.AppendText : string * System.Speech.Synthesis.PromptEmphasis -> unit
Public Sub AppendText (textToSpeak As String, emphasis As PromptEmphasis)
Parametry
- textToSpeak
- String
Řetězec obsahující text, který se má vyslovit.
- emphasis
- PromptEmphasis
Hodnota pro zdůraznění nebo stres, která se má na text použít.
Poznámky
Moduly syntézy řeči v Windows v tuto chvíli nepodporují parametr zdůraznění. Nastavení hodnot pro zvýraznit parametr nebude mít v syntetizovaném výstupu řeči žádnou zvukovou změnu.
Platí pro
AppendText(String, PromptRate)
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
Připojí text k objektu PromptBuilder a určuje míru mluvení textu.
public:
void AppendText(System::String ^ textToSpeak, System::Speech::Synthesis::PromptRate rate);
public void AppendText(string textToSpeak, System.Speech.Synthesis.PromptRate rate);
member this.AppendText : string * System.Speech.Synthesis.PromptRate -> unit
Public Sub AppendText (textToSpeak As String, rate As PromptRate)
Parametry
- textToSpeak
- String
Řetězec obsahující text, který se má vyslovit.
- rate
- PromptRate
Hodnota pro mluvenou sazbu, která se má použít u textu.
Příklady
Následující příklad vytvoří PromptBuilder objekt a připojí textové řetězce. Příklad používá metodu AppendText k určení pomalé mluvení pro přidaný řetězec, který vyčísluje obsah objednávky.
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 add content.
PromptBuilder speakRate = new PromptBuilder();
speakRate.AppendText("Your order for");
speakRate.AppendText("one kitchen sink and one faucet", PromptRate.Slow);
speakRate.AppendText("has been confirmed.");
// Speak the contents of the SSML prompt.
synth.Speak(speakRate);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
Platí pro
AppendText(String, PromptVolume)
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
- Zdroj:
- PromptBuilder.cs
Připojí text k objektu PromptBuilder a určuje svazek pro mluvený text.
public:
void AppendText(System::String ^ textToSpeak, System::Speech::Synthesis::PromptVolume volume);
public void AppendText(string textToSpeak, System.Speech.Synthesis.PromptVolume volume);
member this.AppendText : string * System.Speech.Synthesis.PromptVolume -> unit
Public Sub AppendText (textToSpeak As String, volume As PromptVolume)
Parametry
- textToSpeak
- String
Řetězec obsahující text, který se má vyslovit.
- volume
- PromptVolume
Hodnota hlasitosti mluvení (hlasitost) pro text.
Příklady
Následující příklad používá metodu AppendText k určení nastavení svazku SpeechSynthesizer , které má platit pro výstup řeči.
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();
// Build a prompt that applies different volume settings.
PromptBuilder builder = new PromptBuilder();
builder.AppendText("This is the default speaking volume.", PromptVolume.Default);
builder.AppendBreak();
builder.AppendText("This is the extra loud speaking volume.", PromptVolume.ExtraLoud);
builder.AppendBreak();
builder.AppendText("This is the medium speaking volume.", PromptVolume.Medium);
// Speak the prompt.
synth.Speak(builder);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
Poznámky
Nastavení DefaultPromptVolume je plný svazek, který je stejný jako ExtraLoud. Ostatní nastavení snižují objem výstupu řeči vzhledem k celému svazku.