feat: 支持调节vits的一些参数

This commit is contained in:
ikechan8370 2023-03-04 20:54:26 +08:00
parent 59bec4e22a
commit 41ca23dc85
3 changed files with 34 additions and 1 deletions

View file

@ -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()

View file

@ -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: [