SpeechAudioFormatInfo コンストラクター

定義

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

オーバーロード

SpeechAudioFormatInfo(Int32, AudioBitsPerSample, AudioChannel)

SpeechAudioFormatInfo クラスの新しいインスタンスを初期化し、1 秒間のサンプル数、サンプルごとのビット数、およびチャネルの数を指定します。

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

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

SpeechAudioFormatInfo(Int32, AudioBitsPerSample, AudioChannel)

Source:
SpeechAudioFormatInfo.cs
Source:
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メンバー (または Stereoを示しますMono)。

次の例では、 を使用 SpeechAudioFormatInfo して WAV ファイルに出力するオーディオの形式を指定します。 インスタンスは 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[])

Source:
SpeechAudioFormatInfo.cs
Source:
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);
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[]

形式固有データが格納されているバイト配列。

適用対象