API version 17
iOSAndroidWindows
|
説明 |
発話を開始します。
このメソッドはテキストを内部のキューに入れた後、発話の開始、終了を待たずに処理を返します。 テキストの発話は、StartSpeakingメソッドを呼び出した順で行われます。
発話設定を省略した場合、Pitch、PostUtteranceDelay、Rate、Volumeプロパティの値が使用されます。 音声情報を省略した場合、SetVoiceメソッドにより設定された音声が使用されます。
発話が開始すると、state=SpeechSynthesizer.UTTERANCE_STARTEDでUtteranceStateChangedイベントが発生します。 テキストが全て読まれると、state=SpeechSynthesizer.UTTERANCE_FINISHEDでUtteranceStateChangedイベントが発生します。
|
|
|
呼出形式 |
synthesizer.StartSpeaking( text [, uttr , vo] )
|
|
|
戻り値 |
なし
|
|
|
引数 |
String text |
読み上げるテキスト |
|
|
Utterance uttr |
発話設定を持つUtteranceクラスオブジェクト |
|
|
Voice vo |
音声情報を持つVoiceクラスオブジェクト
|
|
例外 |
SPEECH-1 |
音声合成機能がロードされていません。 |
|
|
SPEECH-3 |
発話を開始できませんでした。
|
|
使用例 |
Form Form1 {
X = 0;
Y = 0;
Width = 150;
Height = 150;
SpeechSynthesizer synthesizer {
Function OnUtteranceStateChanged(e) {
print("State:" + str(e.state) + " Text:" + e.text + "\n");
}
}
Button Button1 {
X = 10;
Y = 10;
Width = 100;
Height = 25;
Title = "Start";
function OnTouch(e) {
^.synthesizer.StartSpeaking("Hello world!");
}
}
Button Button2 {
X = 10;
Y = 40;
Width = 100;
Height = 25;
Title = "Stop";
function OnTouch(e) {
^.synthesizer.StopSpeaking(true);
}
}
if ( !$DESIGNTIME ) {
synthesizer.Load();
}
}
|
|
|
関連項目 |
Pitch、PostUtteranceDelay、Rate、Volumeプロパティ SetVoice、StopSpeakingメソッド |
|