Skip to content

Commit

Permalink
modified caption usage, added SPEAK_STOP
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeAkinobu committed Feb 14, 2024
1 parent ec20c1e commit 67068b1
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 13 deletions.
6 changes: 6 additions & 0 deletions content.en/docs/58_sound.md
Expand Up @@ -102,4 +102,10 @@ At the end of playback, a **SPEAK_EVENT_STOP** message is output.

{{<message>}}
SPEAK_EVENT_STOP|(model alias)
{{</message>}}

**SPEAK_STOP** is a message that stops currently playing audio started by **SPEAK_START**. It issues **SPEAK_EVENT_STOP** after confirmed that speaking audio has been stopped.

{{<message>}}
SPEAK_STOP|(model alias)
{{</message>}}
17 changes: 11 additions & 6 deletions content.en/docs/60_text_image.md
Expand Up @@ -92,22 +92,27 @@ As shown in the image below, text can be displayed as captions. The differences
- Automatically disappears after a specified time
- Able to specify any font (ttf)
- Up to two kinds of text outlines can be specified
- Supports .lrc file (v1.0.2)

v1.0.2 and later has the following changes:

- Now support .lrc file playing (v1.0.2)
- Pre-defined style is available `_default` (v1.0.2)
- **CAPTION_SETSTYLE** made simpler, now can omit forth arguments and later.

![caption](/images/caption.png)

To use it, first define the style of the caption (**CAPTION_SETSTYLE**), then display the text referencing that style (**CAPTION_START**).
Use **CAPTION_START** to give a text string to display as caption, or specify .lrc file to play time-course captions. The second argument specifies the caption style, in which you can use `_default` to use the default style. When you want to use other styles, you can set your own style by **CAPTION_SETSTYLE** and specify the user-defined style in **CAPTION_START**.

### Defining Caption Style

The style is defined with **CAPTION_SETSTYLE**.
Define a user style with **CAPTION_SETSTYLE**.

- Argument 1: Alias name of the style (new)
- Argument 2: Font file path. Use system font with "default".
- Argument 3: Text color r,g,b,a
- Argument 4: Color and size of the first outline r,g,b,a,thickness. If no outline is needed, set a or thickness to 0.
- Argument 5: Color and size of the second outline. The specification is the same as above.
- Argument 6: Frame background color r,g,b,a. If not needed, set a to 0.
- Argument 4: (optional) Color and size of the first outline r,g,b,a,thickness. If no outline is needed, set a or thickness to 0.
- Argument 5: (optional) Color and size of the second outline. The specification is the same as above.
- Argument 6: (optional) Frame background color r,g,b,a. If not needed, set a to 0.

{{<message>}}
CAPTION_SETSTYLE|style_alias|fontpath|r,g,b,a|edge1|edge2|basecolor
Expand Down
11 changes: 11 additions & 0 deletions content.en/docs/86_messages.md
Expand Up @@ -680,6 +680,17 @@ SPEAK_EVENT_START|(model alias)
SPEAK_EVENT_STOP|(model alias)
{{</message>}}


**SPEAK_STOP**

Stops the playing speech formaly started by **SPEAK_START** immediately. **SPEAK_EVENT_STOP** will be issued whenever it has been processed successfully (i.e. stopped the playing audio or no audio was played at that time)

{{<message>}}
SPEAK_STOP|(model alias)
SPEAK_EVENT_STOP|(model alias)
{{</message>}}


## Voice Recognition

The content of the message changes depending on the module or plugin used.
Expand Down
6 changes: 6 additions & 0 deletions content.ja/docs/58_sound.md
Expand Up @@ -102,3 +102,9 @@ SPEAK_EVENT_START|(model alias)
{{<message>}}
SPEAK_EVENT_STOP|(model alias)
{{</message>}}

再生中の音声を途中で止めたい場合は **SPEAK_STOP** を使います.発行されたとき,音声が停止あるいは既に停止であることが確認されたときに **SPEAK_EVENT_STOP** が出力されます.

{{<message>}}
SPEAK_STOP|(model alias)
{{</message>}}
19 changes: 12 additions & 7 deletions content.ja/docs/60_text_image.md
Expand Up @@ -90,22 +90,27 @@ TEXTAREA_EVENT_DELETE|alias
- 指定時間経過後に自動で消える
- 任意のフォント (ttf) を指定可能
- 文字の縁取りが2種まで指定可能
- .lrc ファイル対応 (v1.0.2)

v1.0.2 以降は以下の変更があります.

- .lrc ファイルによるタイムライン表示に対応 (v1.0.2)
- デフォルトスタイル `_default` (v1.0.2)
- **CAPTION_SETSTYLE** の第4引数以降を省略可能 (v1.0.2)

![caption](/images/caption.png)

利用では、まずキャプションのスタイルを定義し(**CAPTION_SETSTYLE**)、そのあと、そのスタイルを参照しながらテキストを与えて表示を行う(**CAPTION_START**)という手順になります。
キャプションは **CAPTION_START** にテキストあるいは .lrc ファイルを指定して表示します.第2引数の「キャプションスタイル」に `_default` を指定することでデフォルトのスタイルが使えますが,独自のスタイルを定義したい場合は **CAPTION_SETSTYLE** でキャプションのスタイルを定義してから,その定義したスタイル名を指定して **CAPTION_START** を使います.

### キャプションスタイルの定義

**CAPTION_SETSTYLE** でスタイルを定義します。
**CAPTION_SETSTYLE** でスタイルを定義します。指定しない場合は `_default` が使えます.第3引数まで(エイリアス名,フォントパス,色)が必須で,第4引数以降はより詳細なスタイルを設定したいときに指定します.

- 第1引数:スタイルのエイリアス名(新規)
- 第2引数:フォントファイルのパス。"default" でシステムフォントを利用。
- 第3引数:文字の色 r,g,b,a
- 第4引数:1つ目の縁取りの色および大きさ r,g,b,a,thickness。縁取り不要の場合は a あるいは thinkness を 0 に。
- 第5引数:2つ目の縁取りの色および大きさ。指定は上記と同様。
- 第6引数:枠背景の色 r,g,b,a:不要な場合は a に 0 を指定
- 第4引数:(オプション)1つ目の縁取りの色および大きさ r,g,b,a,thickness。縁取り不要の場合は a あるいは thinkness を 0 に。
- 第5引数:(オプション)2つ目の縁取りの色および大きさ。指定は上記と同様。
- 第6引数:(オプション)枠背景の色 r,g,b,a:不要な場合は a に 0 を指定

{{<message>}}
CAPTION_SETSTYLE|style_alias|fontpath|r,g,b,a|edge1|edge2|basecolor
Expand All @@ -119,7 +124,7 @@ CAPTION_EVENT_SETSTYLE|style_alias

### キャプション表示開始

**CAPTION_START** で新たなキャプションの表示を開始します。
**CAPTION_START** で新たなキャプションの表示を開始します。テキストを直接指定するか、あるいは lrc ファイルを指定します。

- 第1引数:エイリアス名(新規)
- 第2引数:使用する定義済みスタイルのエイリアス名
Expand Down
9 changes: 9 additions & 0 deletions content.ja/docs/86_messages.md
Expand Up @@ -678,6 +678,15 @@ SPEAK_EVENT_START|(model alias)
SPEAK_EVENT_STOP|(model alias)
{{</message>}}

**SPEAK_STOP**

**SPEAK_START** で再生中の音声を止める。音声が停止した、あるいは既に停止であることが確認されたときに **SPEAK_EVENT_STOP** が発行される。

{{<message>}}
SPEAK_STOP|(model alias)
SPEAK_EVENT_STOP|(model alias)
{{</message>}}

## 音声認識

使用するモジュールやプラグインによってメッセージの内容は変わる。
Expand Down

0 comments on commit 67068b1

Please sign in to comment.