Share via


FilePrompt Constructeurs

Définition

Crée une instance de la classe FilePrompt.

Surcharges

FilePrompt(String, SynthesisMediaType)

Crée une nouvelle instance de la classe FilePrompt, et spécifie le chemin d'accès au fichier et son type de média.

FilePrompt(Uri, SynthesisMediaType)

Crée une nouvelle instance de la classe FilePrompt, et spécifie l'emplacement du fichier et son type de média.

FilePrompt(String, SynthesisMediaType)

Crée une nouvelle instance de la classe FilePrompt, et spécifie le chemin d'accès au fichier et son type de média.

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)

Paramètres

path
String

Chemin d'accès du fichier contenant le contenu de l'invite.

media
SynthesisMediaType

Type de média du fichier.

Exemples

L’exemple qui suit crée un FilePrompt objet qui spécifie un chemin d’accès à une invite SSML. Pour prononcer le contenu de l’invite, l’exemple fournit ensuite l' FilePrompt objet en tant qu’argument à la Speak méthode.

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

Voici le fichier SSML que l’exemple précédent référence.

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

Remarques

Vous pouvez utiliser cette classe pour créer un objet à partir d’un fichier SSML (speech synthesis Markup Language) existant que le SpeechSynthesizer peut utiliser pour générer la parole.

S’applique à

FilePrompt(Uri, SynthesisMediaType)

Crée une nouvelle instance de la classe FilePrompt, et spécifie l'emplacement du fichier et son type de média.

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)

Paramètres

promptFile
Uri

URI du fichier contenant le contenu de l'invite.

media
SynthesisMediaType

Type de média du fichier.

S’applique à