windows vista 和windows 7語音識別功能相關簡介:html
相信用過windows vista 和windows 7的人都知道或者瞭解過裏面的語音識別功能。它可使用聲音命令來控制電腦,實現更方便的人機互動,還能夠經過聲音控制窗口、啓動程序、在窗口之間切換,使用菜單和單擊按鈕等功能。利用聲音讓計算機聽寫文本,只要大聲的朗讀字詞,就能夠建立文本文檔,也可在文檔中進行修改或更正錯誤。但此項技術並非很成熟,存在文本識別率不高,許多非微軟的程序不支持Windows的語音命令等缺陷。ios
那麼在咱們的WPF程序中,該如何利用此功能呢?(目前使用改技術意義不大,可是在未來,我相信會有很大的發展,在此,並且是新手,我只是以玩的心態作這些,但願你們不要笑 :) 小程序
在語音合成和語音識別上,微軟提供 Speech SDK 開發包,那麼在咱們的WPF程序中,咱們怎麼使用呢?vim
其實很簡單,咱們主要用到了windows
在System.Speech.Synthesis命名空間下async
程序集: System.Speech(在 System.Speech.dll 中) 的函數
名稱 | 說明 | |
---|---|---|
![]() |
AddLexicon | |
![]() |
Dispose | |
![]() |
Equals | 肯定指定的 Object 是否等於當前的 Object。 (繼承自 Object。) |
![]() |
Finalize | 容許 Object 在「垃圾回收」回收 Object 以前嘗試釋放資源並執行其餘清理操做。 (繼承自 Object。) |
![]() |
GetCurrentlySpokenPrompt | |
![]() |
GetHashCode | 用做特定類型的哈希函數。 (繼承自 Object。) |
![]() |
GetInstalledVoices | 已重載。 Returns the collection of installed TTS voices. |
![]() |
GetType | 獲取當前實例的 Type。 (繼承自 Object。) |
![]() |
MemberwiseClone | 建立當前 Object 的淺表副本。 (繼承自 Object。) |
![]() |
Pause | Pauses the synthesizer. |
![]() |
RemoveLexicon | |
![]() |
Resume | |
![]() |
SelectVoice | Selects a specific voice. |
![]() |
SelectVoiceByHints | 已重載。 Selects a voice with specific voice characteristics. |
![]() |
SetOutputToAudioStream | |
![]() |
SetOutputToDefaultAudioDevice | |
![]() |
SetOutputToNull | |
![]() |
SetOutputToWaveFile | 已重載。 |
![]() |
SetOutputToWaveStream | |
![]() |
Speak | 已重載。 Speaks a prompt. |
![]() |
SpeakAsync | 已重載。 Speaks asynchronously. |
![]() |
SpeakAsyncCancel | Cancels asynchronous speaking of the specified prompt. |
![]() |
SpeakAsyncCancelAll | Cancels asynchronous speaking of all queued prompts. |
![]() |
SpeakSsml | Speaks the specified SSML string. |
![]() |
SpeakSsmlAsync | Speaks the specified text string asynchronously. |
![]() |
ToString | 返回表示當前 Object 的 String。 (繼承自 Object。) |
名稱 | 說明 | |
---|---|---|
![]() |
BookmarkReached | Raised when a bookmark is reached. |
![]() |
PhonemeReached | Raised when a phoneme is reached. |
![]() |
SpeakCompleted | Raised when the SpeechSynthesizer completes the speaking of a prompt. |
![]() |
SpeakProgress | |
![]() |
SpeakStarted | Raised when the SpeechSynthesizer begins the speaking of a prompt. |
![]() |
StateChanged | Raised when the state of the SpeechSynthesizer changes. |
![]() |
VisemeReached | Raised when a viseme is reached. |
![]() |
VoiceChange | Raised when the voice of the SpeechSynthesizer changes. |
其實上面的程序也沒什麼可講的,無非就是幾個方法的調用,沒什麼技術含量,重要部分都已經註釋。最後,要注意的是,別忘記了ui
對System.Speech.Synthesis;命名空間和相關程序集的引用。好了,就娛樂到這裏,次程序在windows 7平臺下使用vs2010編譯經過,並能正常運行(只要你講的普通話接近標準,嘿嘿:) 最後,在運行時別忘記了打開windows自帶的語音識別程序,來進行聆聽,否則,你喊死了計算機都不來鳥你 - -!spa