# ふるまい：概要

## 概要

インライン・タグ付けは、デジタルヒューマンのさまざまな動作を制御するための独自のXMLスタイルです。

現在、インラインタグは以下の3つの目的で使用されます：

* [感情表現](/ops/control/behavior-emotions.md)
* [アクション](/ops/control/behavior-actions.md)
* [カメラ制御](/ops/control/behavior-camera-control.md)

これらのインラインタグは、チャットボットや会話AIによるデジタルヒューマンの発話文（ユーザーに向かって発話させる文）に挿入してください。記法はSSMLと同じです。

例：

```xml
<uneeq:emotion_joy_strong />こんにちは！<uneeq:action_wavehello />はじめまして、ソフィーと申します。<uneeq:custom_event name="camera_close_up" />何か質問はありますか？
```

{% hint style="info" %}
注意 : インラインタグは、マークタグ機能をサポートする音声合成サービスを使用する場合にのみサポートされます。利用できる音声合成サービスは、[Microsoft Azure / Text to Speech](https://learn.microsoft.com/ja-jp/azure/ai-services/speech-service/language-support?tabs=stt#prebuilt-neural-voices)と[Amazon Web Services / Amazon Polly](https://docs.aws.amazon.com/ja_jp/polly/latest/dg/voicelist.html)、[NTTテクノクロス / FutureVoice Crayon](https://www.futurevoice.jp/)です。
{% endhint %}

## 使い方

インライン・タグを使用するには、デジタルヒューマンに喋らせたい発話文の中に希望のタグを追加するだけです。インラインタグはSSMLタグと一体に機能します。

以下はその詳細です：

* 複数のタグを発話文内のどの位置でも使用することができます。
* タグは自動的に閉じます。タグのペア（タグで括る）は不要です。
* 1つのレスポンスに複数の感情を使用できます。
* 複数のアクションを使用できますが、前のアクションが完了していないタイミングで次のアクションタグを過ぎて発話が始まった場合は、後続のアクションは無視されます。
* 競合しないアクションは組み合わせることができます。
* Azure TTSは連続したタグをサポートしていませんが、Amazon Pollyは連続したタグをサポートしています。

いくつか例を示します：

```xml
⭕️ 下記のパターンは動作します。
<uneeq:emotion_joy_strong />Absolutely! <uneeq:action_understandnod />That's absolutely something I can do.

複数のタグで、すべてセルフクローズしたパターン
```

```xml
注意：連続した2つのタグはAzure TTSではサポートされていませんが、Amazon Pollyでは機能します。
Azure TTSの回避策は、タグを単語で区切ることです。

<uneeq:emotion_sadness_strong /><uneeq:action_disappointed/>I'm afraid this won't work.
```

```xml
❌ 下記のパターンは動作しません。

Certainly<uneeq:action_understandnod>, let me see what I can do for you.

タグが閉じていない
```

```xml
❌ 下記のパターンは動作しません。

<uneeq:emotion_anticipation_strong>それはとてもエキサイティングな響きですね！</uneeq:emotion_anticipation_strong>。

旧タイプのビヘイビアラングエッジフォーマットのように開閉タグが使われています。
```

## SSMLとの混在

SSMLは引き続き完全にサポートされています。SynAnimおよびSSMLの使用の最も簡単な例：

```xml
<speak><uneeq:emotion_joy_normal />Hello!</speak>
```

以下は、AzureのSSMLを、そのニューラルボイスの一つと共に使用したより複雑な例です。複数のuneeq:タグを使用することができますが、それらは"voice"タグ内に配置されます。ただし、"prosody"のように、他の要素の外側に配置することもできることに注意してください。

```xml
<!-- Azure Speech Serviceで使用するSSMLコード - 音声合成のためのマークアップ言語 -->
<speak xmlns="http://www.w3.org/2001/10/synthesis"
       xmlns:mstts="http://www.w3.org/2001/mstts"
       xmlns:emo="http://www.w3.org/2009/10/emotionml"
       version="1.0" xml:lang="en-US">

  <!-- 最初の発話: 手を振る動作と「Hey!」という挨拶 -->
  <voice name="en-US-JennyMultilingualNeural">
    <uneeq:action_wavingcalm/><!-- 穏やかに手を振るアクション -->
    Hey!
  </voice>

  <!-- 2番目の発話: 喜びの感情で「会えて嬉しい」と言う -->
  <voice name="en-US-JennyMultilingualNeural">
    <uneeq:emotion_joy_normal /><!-- 通常レベルの喜びの感情を表現 -->
      <prosody rate="+5.00%" pitch="+2.00%" contour="(0%,-0%)"><!-- 話速+5%、ピッチ+2%で発話 -->
        <lang xml:lang="en-US">It's great to see you.</lang><!-- 「会えて嬉しいです」 -->
      </prosody>
  </voice>

  <!-- 3番目の発話: 期待感を持って自己紹介 -->
  <voice name="en-US-JennyMultilingualNeural">
    <uneeq:emotion_anticipation_normal /><!-- 通常レベルの期待感を表現 -->
      <prosody rate="+5.00%" pitch="+2.00%" contour="(0%,-0%)"><!-- 話速+5%、ピッチ+2%で発話 -->
        <lang xml:lang="en-US">I'm Sophie.</lang><!-- 「私はソフィーです」 -->
      </prosody>
  </voice>

  <!-- 4番目の発話: 強い喜びの感情で目的を説明 -->
  <voice name="en-US-JennyMultilingualNeural">
    <uneeq:emotion_joy_strong/><!-- 強い喜びの感情を表現 -->
    I'm here to help out with some recommendations.<!-- 「いくつかの推奨事項についてお手伝いします」 -->
  </voice>

  <!-- 5番目の発話: 通常の喜びの感情で質問 -->
  <voice name="en-US-JennyMultilingualNeural">
    <uneeq:emotion_joy_normal /><!-- 通常レベルの喜びの感情を表現 -->
      <prosody rate="+5.00%" pitch="+2.00%" contour="(70%, -0%) (80%,-30%) (100%,+50%)">
        <!-- 話速+5%、ピッチ+2%、特定のイントネーションパターンで発話 -->
        <lang xml:lang="en-US">How can I help today?</lang><!-- 「今日はどのようにお手伝いできますか？」 -->
    </prosody>
  </voice>
</speak>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalhumans.jp/ops/control/behavior-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
