Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/api/src/opendirector_api/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@
'voice_provider_protocol': 'The voice service returned an invalid response or pagination did not finish. Check its API version.',
'voice_provider_error': 'The voice service request failed. Check the connection and account permissions.',
'voice_provider_timeout': 'The voice service timed out. Check its status and try again.',
'voice_name_taken': 'This account already has a voice with that name. Choose another name.',
'voice_provider_quota': 'The voice service account has insufficient balance or resource packages. Top up and try again.',
"moss_speech_text": "Enter the text to read aloud.",
"moss_speech_voice": "Enter a Voice ID available to your MOSS account.",
"moss_speech_reference": "MOSS speech generation does not accept references. Enter speech text and a Voice ID.",
"zhipu_speech_text": "Enter the text to read aloud, at most 1,024 characters per GLM-TTS request.",
"zhipu_speech_voice": "Select a voice available to your Zhipu account.",
"zhipu_speech_reference": "GLM-TTS does not accept references. Enter speech text and select a voice.",
"moss_prompt_limit": "MOSS requires a nonempty prompt of at most 4,000 characters, including text references.",
"moss_image_size": "MOSS image dimensions must be 256–2048, multiples of 16, and no more than 2,097,152 pixels in total.",
"moss_image_reference": "MOSS image generation does not accept image references or editing inputs.",
Expand Down
10 changes: 10 additions & 0 deletions docs/development/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,16 @@ CREATION_API_URL=http://127.0.0.1:8019 CREATION_WEB_URL=http://127.0.0.1:5179 no

Python 用例使用模拟 HTTP 服务及真实 PNG、MP3,检查请求字段、音色、执行快照、文件探测、工程重开和下载恢复不重复生成。通用错误分类和安全提示由现有错误测试负责。浏览器用例检查两种语言下的提供商及型号列表、获取模型失败的具体原因、音色必填、保存重开和实际音频播放;播放器使用隔离服务的 WAV 替身,不代表 MOSS 已生成语音。真实验收另需有效 MOSS 凭证和音色 ID,并保留实际音频、模型标识及播放器截图。

智谱 BigModel GLM-TTS 接入使用以下检查:

```sh
.venv/bin/python -m pytest tests/test_zhipu.py tests/test_voice_library.py tests/test_generation_errors.py -q
# 真实服务验收(会产生费用):在隔离的 OPENDIRECTOR_ROOT 上启动 opendirector serve 后运行
OPENDIRECTOR_URL=http://127.0.0.1:18238 ZHIPU_API_KEY=... ZHIPU_SAMPLE=/path/to/sample.wav node tests/browser/zhipu_real.mjs
```

Python 用例使用按真实服务响应录制的模拟 HTTP,检查 `/audio/speech` 只请求非流式 WAV 并按 RIFF/WAVE 字节验收(服务默认返回裸 PCM,且部分错误以 HTTP 200 + JSON 返回)、`1113` 余额不足归为额度而非限流、音色库只列出文档中的 7 个预置音色加 `PRIVATE` 复刻音色、复刻前的真实音频校验(mp3/wav、3–30 秒、10 MB)、复刻成功或失败后都删除上传的样本文件、`POST /voice/delete` 删除及重名/不存在的错误映射、试听只从公网 HTTPS 下载且不带凭据,以及统一生成服务的音色预检与执行快照。真实验收需要已充值且开通 GLM-TTS 的 BigModel 账户;保留预置音色与复刻音色生成的实际音频、复刻到删除的完整流程截图,并确认账户中没有遗留的 `voice-clone-input` 文件。


### Voice library / 音色库

Expand Down
4 changes: 4 additions & 0 deletions docs/guides/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ On MOSS Open Platform, select the stable `moss-tts-1.5-flash` or `moss-tts-1.0-p

Choose **Create voice** to upload a local recording, name it, and review its playback, format, size and duration before submitting. vLLM-Omni requires the consent recording ID; adapters such as Drama3 also require the recording transcript. MOSS-TTS-Nano needs a registered voice with reference audio: a listed `default` voice is insufficient. This upload registers the voice with the selected service without adding a canvas reference node.

On Zhipu BigModel Open Platform, select `glm-tts`. The library lists the seven documented system voices and the voices cloned on that account. To clone a voice, upload a 3–30 second MP3 or WAV recording of at most 10 MB; the recording transcript is optional but improves similarity. OpenDirector deletes the uploaded sample from the account after registration. Each request reads at most 1,024 characters, and references are not accepted. Cloned voices can be deleted from the library.

The same provider can also be added as a conversation Agent: click **Fetch models** to read the account's GLM models (for example `glm-4.5-flash` or `glm-5.3-flash`) and select the ones to enable.

Selected voices are saved in the project; favorites are saved as browser preferences. Both are scoped to the configured service and account. Compatible models sharing a service can retain the selection; another service or account requires its own registered voice. Use a voice’s secondary menu to copy its provider ID or delete an uploaded voice where supported. Deletion requires confirmation; MOSS deletion is unavailable until its API supports it. Service errors are shown without credentials; an unsupported model keeps its existing voice controls.

Agents use the same validation through `voice_list`, `voice_create`, and `voice_delete`. The [business CLI](cli.md) also exposes `voice list`, `voice create`, and `voice delete`.
Expand Down
4 changes: 4 additions & 0 deletions docs/guides/user-guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ HTTP 400。

选择**创建音色**,上传本地录音、填写名称,并在提交前检查试听、格式、大小和时长。vLLM-Omni 需要填写授权录音 ID;Drama3 等适配器还必须填写录音逐字稿。MOSS-TTS-Nano 需要带有参考音频的已注册音色,列表中的 `default` 不能代替录音。上传会直接在当前服务注册音色,不创建画布参考音频节点。

在智谱 BigModel 开放平台上选择 `glm-tts`。音色库列出文档中的 7 个系统音色和该账户下已复刻的音色。复刻音色时,上传 3–30 秒、不超过 10 MB 的 MP3 或 WAV 录音;录音逐字稿可选,填写后相似度更高。注册完成后,OpenDirector 会从账户中删除上传的样本文件。每次最多朗读 1,024 个字符,不支持参考素材。复刻音色可以在音色库中删除。

该提供商也可以作为对话 Agent 添加:点击“获取模型”读取账户可用的 GLM 模型(例如 `glm-4.5-flash`、`glm-5.3-flash`),勾选需要启用的模型即可。

所选音色随工程保存,收藏作为浏览器偏好保存,均按服务连接和账户隔离。同一连接下的兼容模型可以保留选择;其他服务或账户必须单独注册音色。音色的更多操作菜单可复制服务端 ID,或在服务支持时删除上传音色。删除前需要确认;MOSS 尚未开放删除操作。服务错误不会显示凭据;不支持音色库的模型保留原有音色控件。

Agent 通过 `voice_list`、`voice_create`、`voice_delete` 使用同一套校验;[业务 CLI](cli.md) 也提供 `voice list`、`voice create`、`voice delete`。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def _parameters(self, spec, config, node, records):
params.update(prompt_enhance=False, watermark=not self.settings.get()['removeWatermark'])
if spec.kind == 'audio' and input_rules(config)['profile'] == 'moss-speech':
params = dict(voice=intent['voice'], response_format='mp3', delivery_method='url', stream=False)
if spec.kind == 'audio' and input_rules(config)['profile'] == 'zhipu-speech':
params = dict(voice=intent['voice'], response_format='wav', stream=False,
watermark_enabled=not self.settings.get()['removeWatermark'])
return params

@staticmethod
Expand All @@ -229,6 +232,8 @@ def _execution(kind, parameters, config):
if kind == 'audio':
if input_rules(config)['profile'] == 'moss-speech':
return dict(kind=kind, voice=parameters['voice'], format='mp3')
if input_rules(config)['profile'] == 'zhipu-speech':
return dict(kind=kind, voice=parameters['voice'], format='wav', sampleRate=24000)
return dict(kind=kind, voice=parameters.get('voice') or ('default' if config['connectionType'] == 'self_hosted' else 'alloy') if config['protocol'] == 'openai' else None,
speaker=parameters.get('speaker') if config['protocol'] != 'openai' else None,
format='mp3', sampleRate=24000 if config['protocol'] != 'openai' else None)
Expand Down
Loading
Loading