API version 17

SpeechSynthesizer.PauseSpeakingメソッド

iOSAndroidWindows

 

説明

発話を中断します。

ResumeSpeakingメソッドで発話を再開します。

 

このメソッドで発話を中断すると、UtteranceStateChangedイベントが発生します。stateはSpeechSynthesizer.UTTERANCE_PAUSEDとなります。

 

呼出形式

synthesizer.PauseSpeaking( immediate )

 

戻り値

なし

 

引数

boolean immediate

trueの場合、即座に発話を中断します。falseの場合、現在発音中の単語を読み上げてから中断します。

 

例外

SPEECH-1

音声合成機能がロードされていません。

 

SPEECH-5

発話を中断できませんでした。

 

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);
  }
 }
 Button Button3 {
  X = 10;
  Y = 70;
  Width = 100;
  Height = 25;
  Title = "Pause";
  function OnTouch(e) {
   ^.synthesizer.PauseSpeaking(false);
  }
 }
 Button Button4 {
  X = 10;
  Y = 100;
  Width = 100;
  Height = 25;
  Title = "Resume";
  function OnTouch(e) {
   ^.synthesizer.ResumeSpeaking();
  }
 }
 if ( !$DESIGNTIME ) {
  synthesizer.Load();
 }
}

 

関連項目

ResumeSpeakingStartSpeakingメソッド

 



「オンラインマニュアル」一覧へ戻る
「Bizの宝箱」TOPへ戻る