fix: 增加新版本voicevox的新speakers

This commit is contained in:
葛胤池 2023-04-29 19:16:54 +08:00
commit 76d261666a
25 changed files with 166 additions and 147 deletions

View file

@ -326,6 +326,42 @@ export async function render (e, pluginKey, htmlPath, data = {}, renderCfg = {})
}
export async function renderUrl (e, url, renderCfg = {}) {
// 云渲染
if (Config.cloudRender) {
url = url.replace(`127.0.0.1:${Config.serverPort || 3321}`, Config.serverHost || `${await getPublicIP()}:${Config.serverPort || 3321}`)
const resultres = await fetch(`${Config.cloudTranscode}/screenshot`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: url,
option: {
width: renderCfg.Viewport.width || 1280,
height: renderCfg.Viewport.height || 720,
timeout: 120000,
selector: Config.live2d ? "#live2d-widget" : "body",
wait: renderCfg.wait || 1000
},
type: 'image'
})
})
if (resultres.ok) {
const buff = Buffer.from(await resultres.arrayBuffer())
if(buff) {
const base64 = segment.image(buff)
if (renderCfg.retType === 'base64') {
return base64
}
let ret = true
if (base64) {
ret = await e.reply(base64)
}
return renderCfg.retType === 'msgId' ? ret : true
}
}
}
await _puppeteer.browserInit()
const page = await _puppeteer.browser.newPage()
let base64

View file

@ -103,14 +103,15 @@ const defaultConfig = {
slackClaudeGlobalPreset: '',
slackClaudeSpecifiedChannel: '',
cloudTranscode: 'https://silk.201666.xyz',
cloudMode: 'file',
cloudRender: false,
cloudMode: 'url',
ttsMode: 'vits-uma-genshin-honkai', // or azure
azureTTSKey: '',
azureTTSRegion: '',
azureTTSSpeaker: 'zh-CN-XiaochenNeural',
voicevoxSpace: '',
voicevoxTTSSpeaker: '护士机器子T',
version: 'v2.5.7'
version: 'v2.5.8'
}
const _path = process.cwd()

View file

@ -220,6 +220,27 @@ const supportConfigurations = [
speaker_uuid: '7d1e7ba7-f957-40e5-a3fc-da49f769ab65',
styles: [{ name: 'ノーマル', id: 53 }],
version: '0.14.2'
}]
}, {
supported_features: { permitted_synthesis_morphing: 'ALL' },
name: '春歌ナナ',
speaker_uuid: 'ba5d2428-f7e0-4c20-ac41-9dd56e9178b4',
styles: [{ name: 'ノーマル', id: 54 }],
version: '0.14.3'
},
{
supported_features: { permitted_synthesis_morphing: 'ALL' },
name: '猫使アル',
speaker_uuid: '00a5c10c-d3bd-459f-83fd-43180b521a44',
styles: [{ name: 'ノーマル', id: 55 }, { name: 'おちつき', id: 56 }, { name: 'うきうき', id: 57 }],
version: '0.14.3'
},
{
supported_features: { permitted_synthesis_morphing: 'ALL' },
name: '猫使ビィ',
speaker_uuid: 'c20a2254-0349-4470-9fc8-e5c0f8cf3404',
styles: [{ name: 'ノーマル', id: 58 }, { name: 'おちつき', id: 59 }, { name: '人見知り', id: 60 }],
version: '0.14.3'
}
]
export default { generateAudio, supportConfigurations }