PromptBuilder.StartVoice 方法

定義

指示合成器變更 PromptBuilder 物件中的語音。

多載

StartVoice(VoiceGender, VoiceAge)

指示合成器變更 PromptBuilder 物件中的語音,並指定新語音的性別和年齡。

StartVoice(String)

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的名稱。

StartVoice(VoiceGender, VoiceAge, Int32)

指示合成器變更 PromptBuilder 物件中的語音,並指定其性別、年齡,以及符合指定性別和年齡的慣用語音。

StartVoice(VoiceGender)

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的性別。

StartVoice(CultureInfo)

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的文化特性。

StartVoice(VoiceInfo)

指示合成器變更 PromptBuilder 物件中的語音,並指定新語音的準則。

備註

語音代表已安裝的 TTS 引擎。 GetInstalledVoices使用 方法和 VoiceInfo 類別來取得所安裝文字轉換語音 (TTS 的名稱和屬性,) 您可以選取的語音。

當應用程式呼叫 GetInstalledVoices 時,此方法會確認它在登錄中找到的每個語音都符合特定的最低準則。 針對任何失敗驗證的語音, GetInstalledVoices 將其 Enabled 屬性設定為 False 。 應用程式無法在屬性為 False 的語音 Enabled 上呼叫任何 StartVoice 方法。 一般而言,應用程式不會設定語音的屬性 Enabled

StartVoice(VoiceGender, VoiceAge)

來源:
PromptBuilder.cs
來源:
PromptBuilder.cs
來源:
PromptBuilder.cs

指示合成器變更 PromptBuilder 物件中的語音,並指定新語音的性別和年齡。

public:
 void StartVoice(System::Speech::Synthesis::VoiceGender gender, System::Speech::Synthesis::VoiceAge age);
public void StartVoice (System.Speech.Synthesis.VoiceGender gender, System.Speech.Synthesis.VoiceAge age);
member this.StartVoice : System.Speech.Synthesis.VoiceGender * System.Speech.Synthesis.VoiceAge -> unit
Public Sub StartVoice (gender As VoiceGender, age As VoiceAge)

參數

gender
VoiceGender

要使用之新語音的性別。

age
VoiceAge

要使用之語音的年齡。

備註

GetInstalledVoices使用 方法和 VoiceInfo 類別來取得所安裝文字轉換語音 (TTS 的名稱和屬性,) 您可以選取的語音。

若要停止使用呼叫 EndVoiceStartVoice 指定的語音。

適用於

StartVoice(String)

來源:
PromptBuilder.cs
來源:
PromptBuilder.cs
來源:
PromptBuilder.cs

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的名稱。

public:
 void StartVoice(System::String ^ name);
public void StartVoice (string name);
member this.StartVoice : string -> unit
Public Sub StartVoice (name As String)

參數

name
String

要使用之語音的名稱。

備註

若要取得所安裝語音的相關資訊,請使用其中 GetInstalledVoices 一種方法。

若要停止使用呼叫 EndVoiceStartVoice 指定的語音。

適用於

StartVoice(VoiceGender, VoiceAge, Int32)

來源:
PromptBuilder.cs
來源:
PromptBuilder.cs
來源:
PromptBuilder.cs

指示合成器變更 PromptBuilder 物件中的語音,並指定其性別、年齡,以及符合指定性別和年齡的慣用語音。

public:
 void StartVoice(System::Speech::Synthesis::VoiceGender gender, System::Speech::Synthesis::VoiceAge age, int voiceAlternate);
public void StartVoice (System.Speech.Synthesis.VoiceGender gender, System.Speech.Synthesis.VoiceAge age, int voiceAlternate);
member this.StartVoice : System.Speech.Synthesis.VoiceGender * System.Speech.Synthesis.VoiceAge * int -> unit
Public Sub StartVoice (gender As VoiceGender, age As VoiceAge, voiceAlternate As Integer)

參數

gender
VoiceGender

要使用之語音的性別。

age
VoiceAge

要使用之語音的年齡。

voiceAlternate
Int32

整數,當一個以上的語音符合 genderage 參數時,這個整數會指定慣用語音。

備註

語音合成引擎會計算它針對指定參數所尋找的相符專案,並在計數等於 voiceAlternate 參數時傳回語音。

GetInstalledVoices使用 方法和 VoiceInfo 類別來取得所安裝文字轉換語音 (TTS 的名稱和屬性,) 您可以選取的語音。

若要停止使用呼叫 EndVoiceStartVoice 指定的語音。

另請參閱

適用於

StartVoice(VoiceGender)

來源:
PromptBuilder.cs
來源:
PromptBuilder.cs
來源:
PromptBuilder.cs

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的性別。

public:
 void StartVoice(System::Speech::Synthesis::VoiceGender gender);
public void StartVoice (System.Speech.Synthesis.VoiceGender gender);
member this.StartVoice : System.Speech.Synthesis.VoiceGender -> unit
Public Sub StartVoice (gender As VoiceGender)

參數

gender
VoiceGender

要使用之語音的性別。

備註

GetInstalledVoices使用 方法和 VoiceInfo 類別來取得所安裝文字轉換語音 (TTS 的名稱和屬性,) 您可以選取的語音。

若要停止使用呼叫 EndVoiceStartVoice 指定的語音。

適用於

StartVoice(CultureInfo)

來源:
PromptBuilder.cs
來源:
PromptBuilder.cs
來源:
PromptBuilder.cs

指示合成器變更 PromptBuilder 物件中的語音,並指定要使用之語音的文化特性。

public:
 void StartVoice(System::Globalization::CultureInfo ^ culture);
public void StartVoice (System.Globalization.CultureInfo culture);
member this.StartVoice : System.Globalization.CultureInfo -> unit
Public Sub StartVoice (culture As CultureInfo)

參數

culture
CultureInfo

提供特定文化特性的相關資訊,例如語言、文化特性的名稱、書寫系統、使用的行事曆,以及如何格式化日期和排序字串。

備註

cultureStartVoice 參數可以不同于 Culture 包含它的 物件的 屬性 PromptBuilder 。 生效時,參數的值 culture 將會覆寫 Culture 屬性。 SpeechSynthesizer會嘗試選取已安裝的語音,以支援 參數所 culture 指定的語言,以讀出 和 EndVoice 所括的內容 StartVoice 。 如果找到具有指定文化特性的語音,則會使用它。 如果找不到具有指定文化特性的語音,則會使用預設語音。 若要停止使用 指定的 StartVoice 語音,請呼叫 EndVoice

若要以 參數指定的 culture 語言正確發音單字,必須安裝支援語言的語音合成 (文字轉換或 TTS) 引擎。 已安裝的 TTS 引擎稱為語音。 若要取得特定文化特性所安裝語音的相關資訊,請使用 GetInstalledVoices 方法。

Microsoft Windows 和 System.Speech API 接受所有有效的語言國家/地區代碼作為 的值 culture 。 隨附于 Windows 7 的 TTS 引擎支援下列語言國家/地區代碼:

  • en-US. 英文 (美國)

  • zh-CN. 簡體中文

  • zh-TW。 中文 (台灣)

也允許使用雙字母語言代碼,例如 「en」。

適用於

StartVoice(VoiceInfo)

來源:
PromptBuilder.cs
來源:
PromptBuilder.cs
來源:
PromptBuilder.cs

指示合成器變更 PromptBuilder 物件中的語音,並指定新語音的準則。

public:
 void StartVoice(System::Speech::Synthesis::VoiceInfo ^ voice);
public void StartVoice (System.Speech.Synthesis.VoiceInfo voice);
member this.StartVoice : System.Speech.Synthesis.VoiceInfo -> unit
Public Sub StartVoice (voice As VoiceInfo)

參數

voice
VoiceInfo

要使用之語音的準則。

備註

GetInstalledVoices使用 方法和 VoiceInfo 類別來取得所安裝文字轉換語音 (TTS 的名稱和屬性,) 您可以選取的語音。

若要停止使用呼叫 EndVoiceStartVoice 指定的語音。

適用於