修正语音音色名:6 个里有 4 个是错的
之前那份火山音色列表是照着印象写的,对着官方音色列表核对后发现: BV700_streaming 写「通用女声(BV700)」 实际叫「灿灿」 BV001_streaming 写「通用女声 2」 实际叫「通用女声」 BV701_streaming 写「通用男声 2」 实际叫「擎苍」(有声阅读) BV064_streaming 写「甜美女声」 实际叫「小萝莉」 BV138_streaming 写「沉稳男声」 实际叫「情感女声-Lawrence」 音色名是用户唯一的识别依据,标错等于让人盲选(想选男声结果选到有声阅读)。 现在换成 12 个全部核对过的音色,并把 BV700_V2 / BV701_V2 这些 2.0 版本也加上。 回归防线:verify-speech.mjs 加了「音色名和官方列表一致」断言, 钉死 4 个已知对应关系,以后改错会被验收脚本拦下来。 来源:https://docs.volcengine.com/docs/DoubaoVoice/Tonelist
This commit is contained in:
@@ -326,14 +326,24 @@ DEFAULT_SPEECH = {
|
|||||||
'ttsModel': 'tts-1',
|
'ttsModel': 'tts-1',
|
||||||
}
|
}
|
||||||
|
|
||||||
# 常用音色,给界面做下拉。火山那几个是文档里的常见 voice_type。
|
# 常用音色。★ 名字全部照官方音色列表核对过:
|
||||||
|
# https://docs.volcengine.com/docs/DoubaoVoice/Tonelist
|
||||||
|
# 之前这份列表是按印象写的,实测 6 个里错了 4 个(BV701 其实叫「擎苍」不是「通用男声2」,
|
||||||
|
# BV138 是「情感女声-Lawrence」不是「沉稳男声」)。音色名是用户唯一的识别依据,
|
||||||
|
# 写错等于让人盲选,所以这里宁可少列几个也要列准。
|
||||||
VOLC_VOICES = [
|
VOLC_VOICES = [
|
||||||
{'value': 'BV700_streaming', 'label': '通用女声(BV700)'},
|
{'value': 'BV700_streaming', 'label': '灿灿 · 通用女声(22 种情感,推荐)'},
|
||||||
{'value': 'BV001_streaming', 'label': '通用女声 2(BV001)'},
|
{'value': 'BV700_V2_streaming', 'label': '灿灿 2.0(升级版)'},
|
||||||
{'value': 'BV002_streaming', 'label': '通用男声(BV002)'},
|
{'value': 'BV001_streaming', 'label': '通用女声'},
|
||||||
{'value': 'BV701_streaming', 'label': '通用男声 2(BV701)'},
|
{'value': 'BV001_V2_streaming', 'label': '通用女声 2.0'},
|
||||||
{'value': 'BV064_streaming', 'label': '甜美女声(BV064)'},
|
{'value': 'BV002_streaming', 'label': '通用男声'},
|
||||||
{'value': 'BV138_streaming', 'label': '沉稳男声(BV138)'},
|
{'value': 'BV701_streaming', 'label': '擎苍 · 有声阅读'},
|
||||||
|
{'value': 'BV701_V2_streaming', 'label': '擎苍 2.0'},
|
||||||
|
{'value': 'BV705_streaming', 'label': '炀炀 · 自然对话'},
|
||||||
|
{'value': 'BV009_streaming', 'label': '知性女声'},
|
||||||
|
{'value': 'BV007_streaming', 'label': '亲切女声'},
|
||||||
|
{'value': 'BV123_streaming', 'label': '阳光青年'},
|
||||||
|
{'value': 'BV406_streaming', 'label': '超自然音色 · 梓梓'},
|
||||||
]
|
]
|
||||||
|
|
||||||
OPENAI_VOICES = [
|
OPENAI_VOICES = [
|
||||||
|
|||||||
@@ -100,6 +100,24 @@ check('默认引擎是 system(不联网)', st.speech?.ttsEngine === 'system'
|
|||||||
check('音色选项已下发', Array.isArray(st.speechVoices?.volc) && st.speechVoices.volc.length > 0,
|
check('音色选项已下发', Array.isArray(st.speechVoices?.volc) && st.speechVoices.volc.length > 0,
|
||||||
`火山 ${st.speechVoices?.volc?.length} 个 / OpenAI ${st.speechVoices?.openai?.length} 个`);
|
`火山 ${st.speechVoices?.volc?.length} 个 / OpenAI ${st.speechVoices?.openai?.length} 个`);
|
||||||
|
|
||||||
|
// 音色名是用户唯一的识别依据,必须对得上官方列表。
|
||||||
|
// 之前这份列表是凭印象写的,6 个错了 4 个(BV701 官方叫「擎苍」不是「通用男声2」),
|
||||||
|
// 所以这里钉死几个已知正确的对应关系,防止再被改错。
|
||||||
|
const VOICE_TRUTH = {
|
||||||
|
BV700_streaming: '灿灿',
|
||||||
|
BV001_streaming: '通用女声',
|
||||||
|
BV002_streaming: '通用男声',
|
||||||
|
BV701_streaming: '擎苍',
|
||||||
|
};
|
||||||
|
const volcVoices = st.speechVoices?.volc || [];
|
||||||
|
let voiceBad = [];
|
||||||
|
for (const [id, name] of Object.entries(VOICE_TRUTH)) {
|
||||||
|
const hit = volcVoices.find((v) => v.value === id);
|
||||||
|
if (!hit) voiceBad.push(`${id} 缺失`);
|
||||||
|
else if (!hit.label.includes(name)) voiceBad.push(`${id} 名字是「${hit.label}」,官方叫「${name}」`);
|
||||||
|
}
|
||||||
|
check('音色名和官方列表一致', voiceBad.length === 0, voiceBad.join(';') || `${Object.keys(VOICE_TRUTH).length} 个已核对`);
|
||||||
|
|
||||||
const ttsSystem = await api('/api/tts', {
|
const ttsSystem = await api('/api/tts', {
|
||||||
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ text: '你好' }),
|
body: JSON.stringify({ text: '你好' }),
|
||||||
|
|||||||
@@ -261,13 +261,25 @@ export const DEFAULT_SPEECH = {
|
|||||||
ttsModel: 'tts-1',
|
ttsModel: 'tts-1',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用音色。★ 名字照官方音色列表核对过:
|
||||||
|
* https://docs.volcengine.com/docs/DoubaoVoice/Tonelist
|
||||||
|
* 之前是凭印象写的,6 个错了 4 个(BV701 叫「擎苍」不是「通用男声2」)。
|
||||||
|
* 音色名是用户唯一的识别依据,写错等于让人盲选。
|
||||||
|
*/
|
||||||
export const VOLC_VOICES = [
|
export const VOLC_VOICES = [
|
||||||
{ value: 'BV700_streaming', label: '通用女声(BV700)' },
|
{ value: 'BV700_streaming', label: '灿灿 · 通用女声(22 种情感,推荐)' },
|
||||||
{ value: 'BV001_streaming', label: '通用女声 2(BV001)' },
|
{ value: 'BV700_V2_streaming', label: '灿灿 2.0(升级版)' },
|
||||||
{ value: 'BV002_streaming', label: '通用男声(BV002)' },
|
{ value: 'BV001_streaming', label: '通用女声' },
|
||||||
{ value: 'BV701_streaming', label: '通用男声 2(BV701)' },
|
{ value: 'BV001_V2_streaming', label: '通用女声 2.0' },
|
||||||
{ value: 'BV064_streaming', label: '甜美女声(BV064)' },
|
{ value: 'BV002_streaming', label: '通用男声' },
|
||||||
{ value: 'BV138_streaming', label: '沉稳男声(BV138)' },
|
{ value: 'BV701_streaming', label: '擎苍 · 有声阅读' },
|
||||||
|
{ value: 'BV701_V2_streaming', label: '擎苍 2.0' },
|
||||||
|
{ value: 'BV705_streaming', label: '炀炀 · 自然对话' },
|
||||||
|
{ value: 'BV009_streaming', label: '知性女声' },
|
||||||
|
{ value: 'BV007_streaming', label: '亲切女声' },
|
||||||
|
{ value: 'BV123_streaming', label: '阳光青年' },
|
||||||
|
{ value: 'BV406_streaming', label: '超自然音色 · 梓梓' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const OPENAI_VOICES = [
|
export const OPENAI_VOICES = [
|
||||||
|
|||||||
Reference in New Issue
Block a user