FilePrompt Constructores

Definición

Crea una nueva instancia de la clase FilePrompt.

Sobrecargas

FilePrompt(String, SynthesisMediaType)

Crea una nueva instancia de la clase FilePrompt y especifica la ruta de acceso al archivo y su tipo de medio.

FilePrompt(Uri, SynthesisMediaType)

Crea una nueva instancia de la clase FilePrompt y especifica la ubicación del archivo y su tipo de medio.

FilePrompt(String, SynthesisMediaType)

Crea una nueva instancia de la clase FilePrompt y especifica la ruta de acceso al archivo y su tipo de medio.

public:
 FilePrompt(System::String ^ path, System::Speech::Synthesis::SynthesisMediaType media);
public FilePrompt (string path, System.Speech.Synthesis.SynthesisMediaType media);
new System.Speech.Synthesis.FilePrompt : string * System.Speech.Synthesis.SynthesisMediaType -> System.Speech.Synthesis.FilePrompt
Public Sub New (path As String, media As SynthesisMediaType)

Parámetros

path
String

Ruta de acceso del archivo que contiene el contenido del mensaje.

media
SynthesisMediaType

Tipo de medio del archivo.

Ejemplos

En el ejemplo siguiente se crea un FilePrompt objeto que especifica una ruta de acceso a un símbolo del sistema de SSML. Para decir el contenido del mensaje, el ejemplo proporciona el FilePrompt objeto como argumento para el método Speak .

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 FilePrompt object that references an SSML prompt.  
                FilePrompt ssmlFile = new FilePrompt("c:\\test\\Weather.ssml", SynthesisMediaType.Ssml);  

                // Speak the contents of the SSML prompt.  
                synth.Speak(ssmlFile);  
            }  

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

A continuación se muestra el archivo SSML al que hace referencia el ejemplo anterior.

<?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>  

Comentarios

Puede usar esta clase para crear un objeto a partir de un archivo existente del lenguaje de marcado de síntesis de voz (SSML) que puede SpeechSynthesizer consumir para generar voz.

Se aplica a

FilePrompt(Uri, SynthesisMediaType)

Crea una nueva instancia de la clase FilePrompt y especifica la ubicación del archivo y su tipo de medio.

public:
 FilePrompt(Uri ^ promptFile, System::Speech::Synthesis::SynthesisMediaType media);
public FilePrompt (Uri promptFile, System.Speech.Synthesis.SynthesisMediaType media);
new System.Speech.Synthesis.FilePrompt : Uri * System.Speech.Synthesis.SynthesisMediaType -> System.Speech.Synthesis.FilePrompt
Public Sub New (promptFile As Uri, media As SynthesisMediaType)

Parámetros

promptFile
Uri

El URI del archivo que contiene el contenido del mensaje.

media
SynthesisMediaType

Tipo de medio del archivo.

Se aplica a