SpeechAudioFormatInfo Constructors

Definitie

Initialiseert een nieuw exemplaar van de SpeechAudioFormatInfo klasse.

Overloads

Name Description
SpeechAudioFormatInfo(Int32, AudioBitsPerSample, AudioChannel)

Initialiseert een nieuw exemplaar van de SpeechAudioFormatInfo klasse en geeft de voorbeelden per seconde, bits per steekproef en het aantal kanalen op.

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

Initialiseert een nieuw exemplaar van de SpeechAudioFormatInfo klasse en specificeert de coderingsindeling, voorbeelden per seconde, bits per steekproef, aantal kanalen, gemiddelde bytes per seconde, blokuitlijningswaarde en een matrix met indelingsspecifieke gegevens.

SpeechAudioFormatInfo(Int32, AudioBitsPerSample, AudioChannel)

Bron:
SpeechAudioFormatInfo.cs
Bron:
SpeechAudioFormatInfo.cs
Bron:
SpeechAudioFormatInfo.cs
Bron:
SpeechAudioFormatInfo.cs

Initialiseert een nieuw exemplaar van de SpeechAudioFormatInfo klasse en geeft de voorbeelden per seconde, bits per steekproef en het aantal kanalen op.

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)

Parameters

samplesPerSecond
Int32

De waarde voor de steekproeven per seconde.

bitsPerSample
AudioBitsPerSample

De waarde voor de bits per steekproef.

channel
AudioChannel

Een lid van de AudioChannel opsomming (waarmee wordt aangegeven Mono of Stereo).

Voorbeelden

In het volgende voorbeeld ziet u een typisch gebruik van SpeechAudioFormatInfo het opgeven van de indeling van audio die moet worden uitgevoerd naar een WAV-bestand. Het SpeechAudioFormatInfo exemplaar is een argument voor de SetOutputToWaveFile methode.

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

Van toepassing op

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

Bron:
SpeechAudioFormatInfo.cs
Bron:
SpeechAudioFormatInfo.cs
Bron:
SpeechAudioFormatInfo.cs
Bron:
SpeechAudioFormatInfo.cs

Initialiseert een nieuw exemplaar van de SpeechAudioFormatInfo klasse en specificeert de coderingsindeling, voorbeelden per seconde, bits per steekproef, aantal kanalen, gemiddelde bytes per seconde, blokuitlijningswaarde en een matrix met indelingsspecifieke gegevens.

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

Parameters

encodingFormat
EncodingFormat

De coderingsindeling.

samplesPerSecond
Int32

De waarde voor de steekproeven per seconde.

bitsPerSample
Int32

De waarde voor de bits per steekproef.

channelCount
Int32

De waarde voor het aantal kanalen.

averageBytesPerSecond
Int32

De waarde voor het gemiddelde aantal bytes per seconde.

blockAlign
Int32

De waarde voor BlockAlign.

formatSpecificData
Byte[]

Een bytematrix met de indelingsspecifieke gegevens.

Van toepassing op