Bagikan melalui


AudioState Enum

Definisi

Berisi daftar kemungkinan status untuk input audio ke mesin pengenalan ucapan.

public enum class AudioState
public enum AudioState
type AudioState = 
Public Enum AudioState
Warisan
AudioState

Bidang

Silence 1

Menerima keheningan atau kebisingan latar belakang non-ucapan.

Speech 2

Menerima input ucapan.

Stopped 0

Tidak memproses input audio.

Contoh

Contoh berikut menunjukkan penanganan aktivitas yang menangani perubahan status audio pengenal ucapan.

private SpeechRecognitionEngine sre;  

// Initializes the speech recognition engine.  
private void Initialize()  
{  
  sre = new SpeechRecognitionEngine();  

  // Add a handler for the AudioStateChanged event.  
  sre.AudioStateChanged += new EventHandler<AudioStateChangedEventArgs>(sre_AudioStateChanged);  

  // Add other initialization code here.  
}  

  // Handle the AudioStateChanged event.  
  void sre_AudioStateChanged(object sender, AudioStateChangedEventArgs e)  
{  
  AudioState newState = e.AudioState;  

  // Handle event here.  
}  

Keterangan

Anda dapat memperoleh status input audio mesin pengenalan ucapan dengan SpeechRecognitionEngine.AudioState properti dan SpeechRecognizer.AudioState . Peristiwa SpeechRecognitionEngine.AudioStateChanged dan SpeechRecognizer.AudioStateChanged dimunculkan saat status input audio mesin pengenalan ucapan berubah.

Berlaku untuk

Lihat juga