Merge branch 'v2' into v2

This commit is contained in:
ifeif 2023-05-20 11:51:49 +08:00 committed by GitHub
commit f1ca8e2d6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 404 additions and 263 deletions

View file

@ -66,6 +66,10 @@ async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai') {
recordUrl = tmpFile
}
if (recordType === 'file' || Config.cloudMode === 'file') {
if (!recordUrl) {
logger.error('云转码错误recordUrl 异常')
return false
}
const formData = new FormData()
let buffer
if (!recordUrl.startsWith('http')) {
@ -87,9 +91,13 @@ async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai') {
method: 'POST',
body: formData
})
let t = await resultres.text()
let t = await resultres.arrayBuffer()
try {
result = JSON.parse(t)
result = {
buffer: {
data: t
}
}
} catch (e) {
logger.error(t)
throw e