> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vivix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Avatar Playground

在构建自己的 UI 之前，可以先通过 Avatar Playground 了解角色如何说话和行动。选择一个示例或上传自己的图片，添加 Persona，然后启动实时会话。

## 1. 打开 Playground

你需要准备 Node.js 22.12+ 和 Vivix Studio 1.1.0+。安装并启动模板：

```bash theme={null}
curl -fsSL https://static.vivi-x.ai/vivix-studio/install.sh | sh
vivix-studio init my-avatar --template avatar-playground
cd my-avatar
npm run dev
```

打开终端中显示的本地地址。在顶部选择 **API Key**，输入你的 API 密钥，然后选择 **Verify & save**。

## 2. 选择示例或使用自己的图片

初次体验对话时，选择 **Chat**。如果要使用自己的图片，请选择 **Start blank**，然后上传图片或粘贴公开的 HTTPS URL。默认输出为 **720p、9:16**；请选择相同宽高比的竖版图片。图片要求请参阅[准备起始图片](https://docs.vivix.ai/cn/streaming-avatar/character/first-image.md)。

你也可以体验其他示例：**Walk** 用于角色在场景中移动，**Performance** 用于预先编排的表演，**Object interaction** 用于操作道具，**Pet** 用于动物角色。每个示例都会加载一套图片和角色配置，你可以在启动实时会话前进行调整。

点击截图可查看完整尺寸。

> [tab] Chat
>
> [![包含可编辑角色配置和头像预览的 Chat 示例](https://mintcdn.com/vivix-20d305ce/5oMJb_fw9oRFFLkA/images/streaming-avatar/playground-chat-persona-v6.webp?fit=max\&auto=format\&n=5oMJb_fw9oRFFLkA\&q=85\&s=a88ab5dbfdcab1890fc9cf62bb097807)](https://docs.vivix.ai/images/streaming-avatar/playground-chat-persona-v6.webp)

> [tab] Walk
>
> [![森林场景中的 Seraphine 和 Persona 编辑器](https://mintcdn.com/vivix-20d305ce/5oMJb_fw9oRFFLkA/images/streaming-avatar/playground-walk-persona-v6.webp?fit=max\&auto=format\&n=5oMJb_fw9oRFFLkA\&q=85\&s=1a00e545157eea408613902ca40430b7)](https://docs.vivix.ai/images/streaming-avatar/playground-walk-persona-v6.webp)

> [tab] Performance
>
> [![包含 Oubao 和 Persona 编辑器的 Performance 示例](https://mintcdn.com/vivix-20d305ce/5oMJb_fw9oRFFLkA/images/streaming-avatar/playground-performance-persona-v6.webp?fit=max\&auto=format\&n=5oMJb_fw9oRFFLkA\&q=85\&s=e53a28d29e5d2a718d3e55fc530dcc11)](https://docs.vivix.ai/images/streaming-avatar/playground-performance-persona-v6.webp)

> [tab] Object interaction
>
> [![Olivia 在整洁的木桌旁与物体互动的示例](https://mintcdn.com/vivix-20d305ce/5oMJb_fw9oRFFLkA/images/streaming-avatar/playground-object-interaction-1-1-0.webp?fit=max\&auto=format\&n=5oMJb_fw9oRFFLkA\&q=85\&s=b5d845d7ecad09a329082f889005e93e)](https://docs.vivix.ai/images/streaming-avatar/playground-object-interaction-1-1-0.webp)

> [tab] Pet
>
> [![包含 Danhuang 和 Persona 编辑器的 Pet 示例](https://mintcdn.com/vivix-20d305ce/5oMJb_fw9oRFFLkA/images/streaming-avatar/playground-pet-persona-v6.webp?fit=max\&auto=format\&n=5oMJb_fw9oRFFLkA\&q=85\&s=bf2c00454827b55cc6487bdd77973105)](https://docs.vivix.ai/images/streaming-avatar/playground-pet-persona-v6.webp)

## 3. 编写 Persona

使用 [Persona](https://docs.vivix.ai/cn/streaming-avatar/character/persona.md) 描述角色是谁、如何说话，以及说话和聆听时如何表现。**Persona (required)** 字段将这些信息整合在一起。可以先写几句话，或者参考[示例](https://docs.vivix.ai/cn/streaming-avatar/character/persona.md#examples)进行调整。

你不需要填写指南中的每一个部分：

![用四个简短句子描述 Runa 性格、回答方式、动作和聆听习惯的 Persona 字段](https://mintcdn.com/vivix-20d305ce/5oMJb_fw9oRFFLkA/images/streaming-avatar/playground-persona-short-v6.webp?fit=max\&auto=format\&n=5oMJb_fw9oRFFLkA\&q=85\&s=a998356fd853e89dd0e47f5e4b6d3965)

如果之后需要补充更多细节，请选择 **Expand**。你可以使用 Markdown 标题组织较长的 Persona，并在 **Markdown preview** 中检查。选择 **Close** 返回配置页面。

## 4. 启动实时会话并对话

选择 **Video preview** 下方的播放按钮。角色出现后，在下方输入消息或启用麦克风。每次只修改一项配置，并重复发送相同的消息以比较结果。编辑图片或 Persona 前，请先结束会话。

## 5. 将这套流程接入你的应用

Playground 与你的应用遵循相同的流程：**图片和 Persona → 创建会话 → 播放视频 → 交换消息**。先完成[快速开始](https://docs.vivix.ai/cn/streaming-avatar/get-started/quickstart.md)，再根据需要选择 [TRTC](https://docs.vivix.ai/cn/streaming-avatar/integrate/trtc.md) 或 [Agora](https://docs.vivix.ai/cn/streaming-avatar/integrate/agora.md) 播放器。

## 6. 常见问题

### 示例是否包含工具、图片切换和脚本表演？

**Performance** 示例包含用于预编排表演和服装切换的工具。应用会处理工具调用、图片变更和播放。请参阅[工具](https://docs.vivix.ai/cn/streaming-avatar/character/tools.md)、[图片切换](https://docs.vivix.ai/cn/streaming-avatar/interaction/outfits-and-scenes.md)和[脚本表演](https://docs.vivix.ai/cn/streaming-avatar/interaction/scripted-performances.md)，了解如何在自己的应用中实现这些能力。

### 在哪里更换音色？

模板使用预设音色。如需选择其他音色，请参阅[音色指南](https://docs.vivix.ai/cn/streaming-avatar/character/voice.md)和 [TTS 配置](https://docs.vivix.ai/cn/streaming-avatar/integrate/speech-synthesis.md)，然后在创建会话时设置 `tts_config`。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.