From 41ca23dc85a34d0c7f84e1bd8c3c42b8b5423283 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sat, 4 Mar 2023 20:54:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E8=B0=83=E8=8A=82vit?= =?UTF-8?q?s=E7=9A=84=E4=B8=80=E4=BA=9B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guoba.support.js | 30 ++++++++++++++++++++++++++++++ utils/config.js | 3 +++ utils/tts.js | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/guoba.support.js b/guoba.support.js index a2f2eb6..d54e671 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -298,6 +298,36 @@ export function supportGuoba () { label: '语音转换API地址', bottomHelpMessage: '前往duplicate空间https://huggingface.co/spaces/ikechan8370/vits-uma-genshin-honkai后查看api地址', component: 'Input' + }, + { + field: 'noiseScale', + label: 'noiseScale', + bottomHelpMessage: '控制情感变化程度', + component: 'InputNumber', + componentProps: { + min: 0, + max: 1 + } + }, + { + field: 'noiseScaleW', + label: 'noiseScaleW', + bottomHelpMessage: '控制音素发音长度', + component: 'InputNumber', + componentProps: { + min: 0, + max: 1 + } + }, + { + field: 'lengthScale', + label: 'lengthScale', + bottomHelpMessage: '控制整体语速', + component: 'InputNumber', + componentProps: { + min: 0, + max: 2 + } } ], // 获取配置数据方法(用于前端填充显示数据) diff --git a/utils/config.js b/utils/config.js index 421bbe2..040a262 100644 --- a/utils/config.js +++ b/utils/config.js @@ -40,6 +40,9 @@ const defaultConfig = { defaultTimeoutMs: 120000, chromeTimeoutMS: 120000, ttsSpace: '', + noiseScale: 0.6, + noiseScaleW: 0.668, + lengthScale: 1.2, version: 'v2.0.17' } const _path = process.cwd() diff --git a/utils/tts.js b/utils/tts.js index 480ba43..3152649 100644 --- a/utils/tts.js +++ b/utils/tts.js @@ -24,7 +24,7 @@ const newFetch = (url, options = {}) => { return fetch(url, mergedOptions) } const space = Config.ttsSpace -export async function generateAudio (text, speaker = '琪亚娜', language = '中文', noiseScale = 0.6, noiseScaleW = 0.668, lengthScale = 1.2) { +export async function generateAudio (text, speaker = '琪亚娜', language = '中文', noiseScale = Config.noiseScale, noiseScaleW = Config.noiseScaleW, lengthScale = Config.lengthScale) { logger.info(`正在使用${speaker},基于文本:'${text}'生成语音`) let body = { data: [