API version 17
iOSAndroidWindows
|
説明 |
発話を停止します。 まだ発話されていないテキストに対する発話も行われません。
このメソッドで発話を中止すると、UtteranceStateChangedイベントが発生します。stateはSpeechSynthesizer.UTTERANCE_CANCELEDとなります。
|
|
|
呼出形式 |
synthesizer.StopSpeaking( [immediate] )
|
|
|
戻り値 |
なし
|
|
|
引数 |
boolean immediate |
trueの場合、即座に発話を停止します。falseの場合、現在発音中の単語を読み上げてから停止します。 デフォルトはtrueです。 Android版
|
|
例外 |
SPEECH-1 |
音声合成機能がロードされていません。 |
|
|
SPEECH-4 |
発話を停止できませんでした。 |
|
|
SPEECH-7 |
発話中ではありません。
|
|
使用例 |
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();
}
}
|
|
|
関連項目 |
StartSpeakingメソッド |
|