SpeechRecognitionEngine.AudioFormat Eigenschap

Definitie

Hiermee haalt u de indeling op van de audio die wordt ontvangen door de SpeechRecognitionEngine.

public:
 property System::Speech::AudioFormat::SpeechAudioFormatInfo ^ AudioFormat { System::Speech::AudioFormat::SpeechAudioFormatInfo ^ get(); };
public System.Speech.AudioFormat.SpeechAudioFormatInfo AudioFormat { get; }
member this.AudioFormat : System.Speech.AudioFormat.SpeechAudioFormatInfo
Public ReadOnly Property AudioFormat As SpeechAudioFormatInfo

Waarde van eigenschap

De indeling van audio bij de invoer voor het SpeechRecognitionEngine exemplaar of null als de invoer niet is geconfigureerd of ingesteld op de null-invoer.

Voorbeelden

In het onderstaande voorbeeld worden AudioFormat gegevens in audio-indeling opgehaald en weergegeven.

static void DisplayAudioDeviceFormat(Label label, SpeechRecognitionEngine recognitionEngine)
{

  if (recognitionEngine != null && label != null)
  {
    label.Text = String.Format("Encoding Format:         {0}\n" +
          "AverageBytesPerSecond    {1}\n" +
          "BitsPerSample            {2}\n" +
          "BlockAlign               {3}\n" +
          "ChannelCount             {4}\n" +
          "SamplesPerSecond         {5}",
          recognitionEngine.AudioFormat.EncodingFormat.ToString(),
          recognitionEngine.AudioFormat.AverageBytesPerSecond,
          recognitionEngine.AudioFormat.BitsPerSample,
          recognitionEngine.AudioFormat.BlockAlign,
          recognitionEngine.AudioFormat.ChannelCount,
          recognitionEngine.AudioFormat.SamplesPerSecond);
    }
  }
}

Opmerkingen

Gebruik een van de volgende methoden om de audio-invoer te configureren:

Van toepassing op

Zie ook