Language

FilePrompt コンストラクター

定義

FilePrompt クラスの新しいインスタンスを作成します。

オーバーロード

Name 説明
FilePrompt(String, SynthesisMediaType)

FilePrompt クラスの新しいインスタンスを作成し、ファイルへのパスとそのメディアの種類を指定します。

FilePrompt(Uri, SynthesisMediaType)

FilePrompt クラスの新しいインスタンスを作成し、ファイルの場所とそのメディアの種類を指定します。

FilePrompt(String, SynthesisMediaType)

ソース:
FilePrompt.cs
ソース:
FilePrompt.cs
ソース:
FilePrompt.cs
ソース:
FilePrompt.cs

FilePrompt クラスの新しいインスタンスを作成し、ファイルへのパスとそのメディアの種類を指定します。

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)

パラメーター

path
String

プロンプトの内容を含むファイルのパス。

media
SynthesisMediaType

ファイルのメディアの種類。

例

次の例では、SSML プロンプトへのパスを指定する FilePrompt オブジェクトを作成します。 プロンプトの内容を読み上げるには、FilePrompt メソッドの引数として 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();
        }
    }
}

前の例で参照する 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>

注釈

このクラスを使用すると、 SpeechSynthesizer が音声を生成するために使用できる既存の音声合成マークアップ言語 (SSML) ファイルからオブジェクトを作成できます。

Important

信頼されていないデータでこの型のインスタンスを使用することは、セキュリティ上のリスクです。 このオブジェクトは、信頼できるデータでのみ使用します。 詳細については、「すべての入力を検証する」を参照してください。

適用対象

FilePrompt(Uri, SynthesisMediaType)

ソース:
FilePrompt.cs
ソース:
FilePrompt.cs
ソース:
FilePrompt.cs
ソース:
FilePrompt.cs

FilePrompt クラスの新しいインスタンスを作成し、ファイルの場所とそのメディアの種類を指定します。

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)

パラメーター

promptFile
Uri

プロンプトの内容を含むファイルの URI。

media
SynthesisMediaType

ファイルのメディアの種類。

注釈

Important

信頼されていないデータでこの型のインスタンスを使用することは、セキュリティ上のリスクです。 このオブジェクトは、信頼できるデータでのみ使用します。 詳細については、「すべての入力を検証する」を参照してください。

適用対象