PromptBuilder.AppendBreak Método

Definición

Inserta un salto (pausa) en el contenido de un PromptBuilder objeto .

Sobrecargas

Nombre Description
AppendBreak()

Anexa un salto al PromptBuilder objeto .

AppendBreak(PromptBreak)

Anexa un salto al PromptBuilder objeto y especifica su intensidad (duración).

AppendBreak(TimeSpan)

Anexa un salto de la duración especificada al PromptBuilder objeto .

AppendBreak()

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

Anexa un salto al PromptBuilder objeto .

public:
 void AppendBreak();
public void AppendBreak();
member this.AppendBreak : unit -> unit
Public Sub AppendBreak ()

Ejemplos

En el ejemplo siguiente se crea un mensaje que contiene dos oraciones separadas por una interrupción y se habla la solicitud al dispositivo de audio predeterminado en el equipo.

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 with two sentences separated by a break.
        PromptBuilder builder = new PromptBuilder(
          new System.Globalization.CultureInfo("en-US"));
        builder.AppendText(
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 8:45.");
        builder.AppendBreak();
        builder.AppendText(
          "Tonight's movie showings in theater B are at 5:15, 7:30, and 9:15.");

        // Speak the prompt.
        synth.Speak(builder);
      }

      Console.WriteLine();
      Console.WriteLine("Press any key to exit...");
      Console.ReadKey();
    }
  }
}

Comentarios

Este método no especifica una duración para la interrupción. SpeechSynthesizer determinará un valor de duración basado en el contexto lingüístico.

Se aplica a

AppendBreak(PromptBreak)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

Anexa un salto al PromptBuilder objeto y especifica su intensidad (duración).

public:
 void AppendBreak(System::Speech::Synthesis::PromptBreak strength);
public void AppendBreak(System.Speech.Synthesis.PromptBreak strength);
member this.AppendBreak : System.Speech.Synthesis.PromptBreak -> unit
Public Sub AppendBreak (strength As PromptBreak)

Parámetros

strength
PromptBreak

Indica la duración de la interrupción.

Ejemplos

En el ejemplo siguiente se crea un mensaje que contiene dos oraciones separadas por un salto y se envía la salida a un archivo WAV para su reproducción.

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.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");

        // Build a prompt with two sentences separated by a break.
        PromptBuilder builder = new PromptBuilder(
          new System.Globalization.CultureInfo("en-US"));
        builder.AppendText(
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 8:45");
        builder.AppendBreak(PromptBreak.Medium);
        builder.AppendText(
          "Tonight's movie showings in theater B are at 5:15, 7:15, and 9:15");

        // 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();
    }
  }
}

Comentarios

Los valores de la PromptBreak enumeración representan un intervalo de intervalos de separación (pausa) entre límites de palabras. El motor de síntesis de voz determina la duración exacta del intervalo. Cuando se solicita una interrupción, uno de estos valores se pasa al motor de texto a voz (TTS), que contiene una asignación entre estos valores y los valores de interrupción milisegundos correspondientes.

Se aplica a

AppendBreak(TimeSpan)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

Anexa un salto de la duración especificada al PromptBuilder objeto .

public:
 void AppendBreak(TimeSpan duration);
public void AppendBreak(TimeSpan duration);
member this.AppendBreak : TimeSpan -> unit
Public Sub AppendBreak (duration As TimeSpan)

Parámetros

duration
TimeSpan

El tiempo en tics, donde un tic es igual a 100 nanosegundos.

Ejemplos

En el ejemplo siguiente se crea una solicitud que contiene dos oraciones separadas por un salto de 15 000 000 tics (1,5 segundos) y habla el mensaje al dispositivo de audio predeterminado en el equipo.

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 with two sentences separated by a break.
        PromptBuilder builder = new PromptBuilder(
          new System.Globalization.CultureInfo("en-US"));
        builder.AppendText(
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 8:45");
        builder.AppendBreak(new TimeSpan(15000000));
        builder.AppendText(
          "Tonight's movie showings in theater B are at 5:15, 7:15, and 9:15");

        // Speak the prompt.
        synth.Speak(builder);
      }

      Console.WriteLine();
      Console.WriteLine("Press any key to exit...");
      Console.ReadKey();
    }
  }
}

Comentarios

Se puede usar un salto para controlar pausas u otros límites prosódicos entre palabras. Una interrupción es opcional. Si no hay un salto, el sintetizador determina la interrupción entre palabras en función del contexto lingüístico.

Se aplica a