言語

SpeechAudioFormatInfo コンストラクター

定義

SpeechAudioFormatInfo クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
SpeechAudioFormatInfo(Int32, AudioBitsPerSample, AudioChannel)

SpeechAudioFormatInfo クラスの新しいインスタンスを初期化し、1 秒あたりのサンプル数、サンプルあたりのビット数、チャネル数を指定します。

SpeechAudioFormatInfo(EncodingFormat, Int32, Int32, Int32, Int32, Int32, Byte[])

SpeechAudioFormatInfo クラスの新しいインスタンスを初期化し、エンコード形式、1 秒あたりのサンプル数、サンプルあたりのビット数、チャネル数、1 秒あたりの平均バイト数、ブロック配置値、および形式固有のデータを含む配列を指定します。

SpeechAudioFormatInfo(Int32, AudioBitsPerSample, AudioChannel)

ソース:
SpeechAudioFormatInfo.cs
ソース:
SpeechAudioFormatInfo.cs
ソース:
SpeechAudioFormatInfo.cs
ソース:
SpeechAudioFormatInfo.cs

SpeechAudioFormatInfo クラスの新しいインスタンスを初期化し、1 秒あたりのサンプル数、サンプルあたりのビット数、チャネル数を指定します。

public:
 SpeechAudioFormatInfo(int samplesPerSecond, System::Speech::AudioFormat::AudioBitsPerSample bitsPerSample, System::Speech::AudioFormat::AudioChannel channel);
public SpeechAudioFormatInfo(int samplesPerSecond, System.Speech.AudioFormat.AudioBitsPerSample bitsPerSample, System.Speech.AudioFormat.AudioChannel channel);
new System.Speech.AudioFormat.SpeechAudioFormatInfo : int * System.Speech.AudioFormat.AudioBitsPerSample * System.Speech.AudioFormat.AudioChannel -> System.Speech.AudioFormat.SpeechAudioFormatInfo
Public Sub New (samplesPerSecond As Integer, bitsPerSample As AudioBitsPerSample, channel As AudioChannel)

パラメーター

samplesPerSecond
Int32

1 秒あたりのサンプルの値。

bitsPerSample
AudioBitsPerSample

サンプルあたりのビット数の値。

channel
AudioChannel

AudioChannel列挙体のメンバー (MonoまたはStereoを示します)。

次の例は、wav ファイルに出力するオーディオの形式を指定する SpeechAudioFormatInfo の一般的な使用方法を示しています。 SpeechAudioFormatInfo インスタンスは、SetOutputToWaveFile メソッドの引数です。

using System;
using System.IO;
using System.Speech.Synthesis;
using System.Speech.AudioFormat;

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:\temp\test.wav",
          new SpeechAudioFormatInfo(32000, AudioBitsPerSample.Sixteen, AudioChannel.Mono));

        // Create a SoundPlayer instance to play output audio file.
        System.Media.SoundPlayer m_SoundPlayer =
          new System.Media.SoundPlayer(@"C:\temp\test.wav");

        // Build a prompt.
        PromptBuilder builder = new PromptBuilder();
        builder.AppendText("This is sample output to a WAVE file.");

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

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

適用対象

SpeechAudioFormatInfo(EncodingFormat, Int32, Int32, Int32, Int32, Int32, Byte[])

ソース:
SpeechAudioFormatInfo.cs
ソース:
SpeechAudioFormatInfo.cs
ソース:
SpeechAudioFormatInfo.cs
ソース:
SpeechAudioFormatInfo.cs

SpeechAudioFormatInfo クラスの新しいインスタンスを初期化し、エンコード形式、1 秒あたりのサンプル数、サンプルあたりのビット数、チャネル数、1 秒あたりの平均バイト数、ブロック配置値、および形式固有のデータを含む配列を指定します。

public:
 SpeechAudioFormatInfo(System::Speech::AudioFormat::EncodingFormat encodingFormat, int samplesPerSecond, int bitsPerSample, int channelCount, int averageBytesPerSecond, int blockAlign, cli::array <System::Byte> ^ formatSpecificData);
public SpeechAudioFormatInfo(System.Speech.AudioFormat.EncodingFormat encodingFormat, int samplesPerSecond, int bitsPerSample, int channelCount, int averageBytesPerSecond, int blockAlign, byte[]? formatSpecificData);
public SpeechAudioFormatInfo(System.Speech.AudioFormat.EncodingFormat encodingFormat, int samplesPerSecond, int bitsPerSample, int channelCount, int averageBytesPerSecond, int blockAlign, byte[] formatSpecificData);
new System.Speech.AudioFormat.SpeechAudioFormatInfo : System.Speech.AudioFormat.EncodingFormat * int * int * int * int * int * byte[] -> System.Speech.AudioFormat.SpeechAudioFormatInfo
Public Sub New (encodingFormat As EncodingFormat, samplesPerSecond As Integer, bitsPerSample As Integer, channelCount As Integer, averageBytesPerSecond As Integer, blockAlign As Integer, formatSpecificData As Byte())

パラメーター

encodingFormat
EncodingFormat

エンコード形式。

samplesPerSecond
Int32

1 秒あたりのサンプルの値。

bitsPerSample
Int32

サンプルあたりのビット数の値。

channelCount
Int32

チャネル数の値。

averageBytesPerSecond
Int32

1 秒あたりの平均バイト数の値。

blockAlign
Int32

BlockAlign の値。

formatSpecificData
Byte[]

形式固有のデータを含むバイト配列。

適用対象