在新的多TTS源模式下添加了VoiceVox源 (#381)

* feat: 添加基于voicevox语音支持

* fix: 配置里添加voicevox语音源

* fix: 切换语音模式对各种语言源提示错误

* fix: 修正voicevox角色风格设置问题

* fix: 修改角色性格切换问题

* fix: 解决角色性格切换问题

* fix 换源分支少打个break(java17-user是这样的)

* fix: 支持云转码的一些调整

---------

Co-authored-by: 葛胤池 <geyinchi@buaa.edu.cn>
This commit is contained in:
2ndelement 2023-04-29 18:45:33 +08:00 committed by GitHub
parent 5099ae9d87
commit 6267d2d842
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 361 additions and 26 deletions

View file

@ -1,6 +1,7 @@
import { Config } from './utils/config.js'
import { speakers } from './utils/tts.js'
import AzureTTS from './utils/tts/microsoft-azure.js'
import VoiceVoxTTS from './utils/tts/voicevox.js'
// 支持锅巴
export function supportGuoba () {
return {
@ -87,6 +88,10 @@ export function supportGuoba () {
{
label: '微软Azure',
value: 'azure'
},
{
label: 'VoiceVox',
value: 'voicevox'
}
]
}
@ -100,6 +105,19 @@ export function supportGuoba () {
options: speakers.concat('随机').map(s => { return { label: s, value: s } })
}
},
{
field: 'voicevoxTTSSpeaker',
label: '语音模式默认角色VoiceVox',
bottomHelpMessage: 'VoiceVox语音模式下未指定角色时使用的角色。若留空将使用随机角色回复。若用户通过指令指定了角色将忽略本设定',
component: 'Select',
componentProps: {
options: VoiceVoxTTS.supportConfigurations.map(item => {
return item.styles.map(style => {
return `${item.name}-${style.name}`
}).concat(item.name)
}).flat().concat('随机').map(s => { return { label: s, value: s } })
}
},
{
field: 'azureTTSSpeaker',
label: '语音模式默认角色微软Azure',
@ -545,6 +563,12 @@ export function supportGuoba () {
bottomHelpMessage: '前往duplicate空间https://huggingface.co/spaces/ikechan8370/vits-uma-genshin-honkai后查看api地址',
component: 'Input'
},
{
field: 'voicevoxSpace',
label: 'voicevox语音转换API地址',
bottomHelpMessage: '可使用https://2ndelement-voicevox.hf.space, 也可github搜索voicevox-engine自建',
component: 'Input'
},
{
field: 'azureTTSKey',
label: 'Azure语音服务密钥',
@ -710,7 +734,7 @@ export function supportGuoba () {
label: 'Live2D模型',
bottomHelpMessage: '选择Live2D使用的模型',
component: 'Input'
},
}
],
// 获取配置数据方法(用于前端填充显示数据)
getConfigData () {