Handling barge-in

September 20, 2013

It often occurs in speech interfaces that a user wants to barge in to the system utterance while the system is speakings. You can handle such a “barge-in” action from a user by creating a dialog script (.fst) as follows:

     1 10 RECOG_EVENT_STOP|こんにちは SYNTH_START|mei|mei_voice_normal|こんにちは。
    10 20 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私の名前はメイと言います。
    20 30 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私は情報案内ができます。
    30 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|ご用件をおっしゃってください。
    10 40 RECOG_EVENT_START SYNTH_STOP|mei 
    20 40 RECOG_EVENT_START SYNTH_STOP|mei 
    30 40 RECOG_EVENT_START SYNTH_STOP|mei
    40 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|はい。
    50  2 SYNTH_EVENT_STOP|mei <eps>

=== Japanese ========================================

音声インタフェースではシステムの発話中にユーザがその発話を遮って音声入力を行うことがあります.これをバージインといいます.以下のように音声対話スクリプト(.fst)を記述することでバージインを扱うことができます.

     1 10 RECOG_EVENT_STOP|こんにちは SYNTH_START|mei|mei_voice_normal|こんにちは。
    10 20 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私の名前はメイと言います。
    20 30 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|私は情報案内ができます。
    30 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|ご用件をおっしゃってください。
    10 40 RECOG_EVENT_START SYNTH_STOP|mei 
    20 40 RECOG_EVENT_START SYNTH_STOP|mei 
    30 40 RECOG_EVENT_START SYNTH_STOP|mei
    40 50 SYNTH_EVENT_STOP|mei SYNTH_START|mei|mei_voice_normal|はい。
    50  2 SYNTH_EVENT_STOP|mei <eps>

MMDAgent can speak any text sentence using the SYNTH_START command.It takes three arguments. The first is the alias of the model to perform lip synchronization with the text. The second is the choice of speaking style as described in the article “Definition of speaking style”.  The third is the text string to be uttered.

The SYNTH_STOP command terminates ongoing speech immediately. The first argument of the command is the model alias currently speaking.

At the end of speech output, a SYNTH_EVENT_STOP event will be issued.

=== Japanese ========================================

SYNTH_STARTコマンドで好きな文を喋らせることができます.第1引数にリップシンクを行うモデルのエイリアス名,第2引数に「Definition of speaking style」のように定義されている発話スタイル名,第3引数に喋らせたい文を記述します.

発話を途中で終了させるにはSYNTH_STOPコマンドを用います.第1引数にはモデルのエイリアス名を記述します.

発話終了時にはSYNTH_EVENT_STOPイベントが発行されます.

When starting motions, you can alter the range of application of the motion by specifying an option at the 4th argument of the MOTION_ADD command.

By specifying FULL option, all bone and expression key frames defined in the motion file (.vmd) are applied.

By specifying PART option, the key frames at the first frame (frame zero) are skipped.  This is the same behavior as dropping motion file (.vmd) with “Shift” key pressed in the article “Motion superimposition”.

=== Japanese ========================================

モーションを実行するMOTION_ADDコマンドでは,第4引数にオプションを指定することで,モーションの適用範囲を変えることができます.

FULLオプションを指定した場合,モーションファイル(.vmd)内で定義されているボーン・表情のキーフレーム全てが適用されます.

PARTオプションを指定した場合,0フレーム目にあるキーフレームがスキップされます.記事「Motion superimposition」で紹介した,モーションファイル(.vmd)を「Shift」キーを押しながらD&Dしたときの動作は,このオプションと同じ動作になっています.

When starting motions, you can determine whether the motion repeats in a loop by specifying the ONCE option or the LOOP option in the 5th argument of the MOTION_ADD command.

By specifying ONCE option, the motion automatically ends after the last frame is played.  When the motion ends, a MOTION_EVENT_DELETE event is issued.

By specifying LOOP option, the motion loops back to the first frame after the last frame is played, and repeats again and again.  A MOTION_DELETE command is should be used to stop the motion.

=== Japanese ========================================

モーションを実行するMOTION_ADDコマンドでは,第5引数にONCEオプションあるいはLOOPオプションを指定することで,モーションをループするかどうかを指定できます.

ONCEオプションを指定した場合,モーションが最終フレームまで再生された後,自動的に終了します.終了時にはMOTION_EVENT_DELETEイベントが発行されます.

LOOPオプションを指定した場合,モーションが最終フレームまで再生され,開始フレームへ戻り,ループ再生されます.モーションを終了させるにはMOTION_DELETEコマンドを使います.

Timer variables

March 29, 2013

A special type of variable called “timer variable” can be used in a dialog scenario file (.fst) as a countdown timer.  When a duration time is set to a timer variable in seconds by using the TIMER_START command, the variable starts counting down from that specified value in units of 0.1 seconds.  When it reaches a value which is below or equal to zero, a TIMER_EVENT_STOP event will be emitted.  In the following example, the system is told to wait three minutes and then synthesize the utterance.

    1  11   RECOG_EVENT_STOP|三分     TIMER_START|timer|180.0
    11 12   TIMER_EVENT_STOP|timer   SYNTH_START|mei|mei_voice_normal|三分経ちました.
    12  2   SYNTH_EVENT_STOP|mei      <eps>
    ("三分" means three minutes, 
    and "三分経ちました." is the Japanese sentence for "three minutes have elapsed".)

=== Japanese ========================================

音声対話スクリプト(.fst)では,通常の変数の他に,時間経過でカウントダウンされる「タイマー変数」を利用できます.TIMER_START コマンドによりタイマー変数に値をセットすると,その代入した秒数から0へ向かって0.1秒単位でカウントダウンが開始されます.値が 0 に達すると TIMER_EVENT_STOP イベントが発行されます.以下は 3 分待ってから「三分経ちました.」と喋る例です.

    1  11   RECOG_EVENT_STOP|三分     TIMER_START|timer|180.0
    11 12   TIMER_EVENT_STOP|timer   SYNTH_START|mei|mei_voice_normal|三分経ちました.
    12  2   SYNTH_EVENT_STOP|mei      <eps>

Random numbers

March 8, 2013

Random values can be set to a variable by specifying maximum and minimum values to the VALUE_SET command.  At execution time, one random number will be chosen inside the specified range and applied to the variable. The following is an example of a rock-paper-scissors game, where one out of the three options is outputted at a time with equal probability.

    1  11   RECOG_EVENT_STOP|じゃんけん      VALUE_SET|x|0|3
    11 12   VALUE_EVENT_SET|x              VALUE_EVAL|x|LE|1
    12 14   VALUE_EVENT_EVAL|x|LE|1|TRUE   SYNTH_START|mei|mei_voice_normal|グー
    12 13   VALUE_EVENT_EVAL|x|LE|1|FALSE  VALUE_EVAL|x|LE|2
    13 14   VALUE_EVENT_EVAL|x|LE|2|TRUE   SYNTH_START|mei|mei_voice_normal|チョキ
    13 14   VALUE_EVENT_EVAL|x|LE|2|FALSE  SYNTH_START|mei|mei_voice_normal|パー
    14  2   SYNTH_EVENT_STOP|mei           <eps>
    ("じゃんけん" means scissors-paper-stone, "グー" is for stone, 
     "チョキ" is for scissors and "パー" is for paper)

In this example, a random value between zero and three will be stored to the variable “x” .  These values are then evaluated by the VALUE_EVENT_EVAL command at each turn and the current value stored in the variable is outputted.

=== Japanese ========================================

音声対話スクリプト (.fst) では変数に乱数を代入することができます.乱数の利用の際には, VALUE_SET コマンドで最大値と最小値を指定します.なお,乱数の値は値を代入した際に固定され,参照・評価には同じ値が使われます.以下にじゃんけんを行う例を示します.

    1  11   RECOG_EVENT_STOP|じゃんけん      VALUE_SET|x|0|3
    11 12   VALUE_EVENT_SET|x              VALUE_EVAL|x|LE|1
    12 14   VALUE_EVENT_EVAL|x|LE|1|TRUE   SYNTH_START|mei|mei_voice_normal|グー
    12 13   VALUE_EVENT_EVAL|x|LE|1|FALSE  VALUE_EVAL|x|LE|2
    13 14   VALUE_EVENT_EVAL|x|LE|2|TRUE   SYNTH_START|mei|mei_voice_normal|チョキ
    13 14   VALUE_EVENT_EVAL|x|LE|2|FALSE  SYNTH_START|mei|mei_voice_normal|パー
    14  2   SYNTH_EVENT_STOP|mei           <eps>

この例では,まず変数 x に 0以上 3 以下の乱数を代入しています.そして, VALUE_EVAL コマンドにより変数に代入された値の評価を行うことで,x の値によってじゃんけんの手を出力します.

Variables

February 15, 2013

In dialog scenario files (.fst), you can set/get any numerical value to a defined variable.  Please note that the variable name is case-sensitive.

A value can be stored in a variable by using the VALUE_SET command.  No previous declaration is needed: in case the variable already exists, its value will be changed with the new specified one.  Otherwise, the new variable will be newly allocated.  A  VALUE_EVENT_SET event will be emitted in case of success.

The value currently stored in one variable can be retrieved with VALUE_GET command.  This will emit a VALUE_EVENT_GET event, with the name of the specified variable and its current value.

One can also compare the value currently stored with any other fixed value by using the VALUE_EVAL command.  It takes a variable name, one of the following comparison operators and a fixed value as arguments.

EQ (EQual) =
NE (Not Equal)
LE (Less or Equal)
LT (Less Than) <
GE (Greater or Equal)
GT (Greater Than) >

The comparison result will appear as a VALUE_EVENT_EVAL event, displaying both the arguments and the result of either TRUE or FALSE.

Finally, a variable can be released from memory with VALUE_UNSET command.  It successfully released, a VALUE_EVENT_UNSET event will be emitted.

=== Japanese ========================================

音声対話スクリプト (.fst) では数値を格納する変数を扱うことができます.変数名のアルファベットの小文字と大文字は区別されます.

変数への代入は VALUE_SET コマンドで行います.宣言は必要ありません.新規名の場合は新規に定義され,すでにある名前の場合は上書きされます.代入終了時には VALUE_EVENT_SET イベントが発行されます.

変数の値の参照は VALUE_GET コマンドで行います.指定された変数名とその値を含む VALUE_EVENT_GET イベントが発行されます.

変数の値を固定値と比較するには VALUE_EVAL コマンドで行います.変数名,比較値および以下の比較演算子の1つを指定します.

EQ (EQual) =
NE (Not Equal)
LE (Less or Equal)
LT (Less Than) <
GE (Greater or Equal)
GT (Greater Than) >

比較終了時には比較結果の TRUE または FALSE を含む VALUE_EVENT_EVAL イベントが発行されます.

変数を解放するには VALUE_UNSET コマンドを用います.変数解放時には VALUE_EVENT_UNSET イベントが発行されます.

MMDAgent generates a speech recognition result as a sequence of keywords.  You can view how your speech input is being recognized in the log window which can be enabled by “D” key.

You can write a dialog scenario file (.fst) to perform some actions to the recognition result.  When you expect only one keyword in the result, the part of the dialog scenario file (.fst) should look like

  1     11     RECOG_EVENT_STOP|こんにちは    SYNTH_START|mei|mei_voice_normal|こんにちは
  (こんにちは means hello.)

When you want to set several keywords to be matched, they can be specified as follows:

  • For AND condition, in case you expect all of the keywords should be included in an utterance.  When multiple keywords are separated by comma like this, all of them should be matched.  Do not insert a space around commas!
  1     11     RECOG_EVENT_STOP|名古屋,天気 SYNTH_START|mei|mei_voice_normal|晴れ
  (名古屋 means Nagoya, 天気 means weather and 晴れ means sunny.)
  • For OR condition, in case you expect any of keywords to be matched. Equivalent words or synonyms can be specified by defining the same arcs with different keywords.  Note that, when several arcs are defined between the same pair of states, they will be evaluated in the order written in the dialog scenario file (.fst).
  1     11     RECOG_EVENT_STOP|昼ごはん  SYNTH_START|mei|mei_voice_normal|いいですね
  1     11     RECOG_EVENT_STOP|ランチ   SYNTH_START|mei|mei_voice_normal|いいですね
  1     11     RECOG_EVENT_STOP|昼食     SYNTH_START|mei|mei_voice_normal|いいですね
  (昼ごはん, ランチ and 昼食 mean lunch and いいですね means good.)

=== Japanese ========================================

MMDAgent では,音声認識の結果をキーワードの列で取得しています.「D」キーを押すと,ログを見ながら自分の発話がどのように認識されているかを確認できます.

認識結果に反応する動作を音声対話スクリプト(.fst)に書く際は,「今日」「天気」のようにキーワードで指定します.ある単独のキーワードに反応させるには,以下のように記述します.

  1     11     RECOG_EVENT_STOP|こんにちは    SYNTH_START|mei|mei_voice_normal|こんにちは

複数のキーワードに反応させる場合は以下のようになります.

  • 複数のキーワードが全て含まれる時に反応させる場合,下記のように半角コンマ(,)で区切って複数のキーワードを記述することで,それら全てのキーワードが認識された時に反応します.半角コンマの直後にはスペース等を入れないでください.
  1     11     RECOG_EVENT_STOP|名古屋, 天気 SYNTH_START|mei|mei_voice_normal|晴れです.
  • 複数のキーワードのどれかが含まれる時に反応させる場合,下記のように複数のキーワードを記述することで,それらのキーワードのいずれかが認識された時に反応します.なお,音声対話スクリプト(.fst)の中である状態からの遷移が複数定義されている場合,上から順に評価されます.
  1     11     RECOG_EVENT_STOP|昼ごはん     SYNTH_START|mei|mei_voice_normal|Aランチがおすすめです.
  1     11     RECOG_EVENT_STOP|ランチ      SYNTH_START|mei|mei_voice_normal|Aランチがおすすめです.
  1     11     RECOG_EVENT_STOP|昼食       SYNTH_START|mei|mei_voice_normal|Aランチがおすすめです.