mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: 初步适配铃音语音
This commit is contained in:
parent
7cc22e487a
commit
61d3b48781
2 changed files with 22 additions and 16 deletions
|
|
@ -39,7 +39,7 @@ if (module) {
|
|||
// import { pcm2slk } from 'node-silk'
|
||||
let errors = {}
|
||||
|
||||
async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai') {
|
||||
async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai', ignoreEncode = false) {
|
||||
let recordType = 'url'
|
||||
let tmpFile = ''
|
||||
if (ttsMode === 'azure') {
|
||||
|
|
@ -48,6 +48,9 @@ async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai') {
|
|||
recordType = 'buffer'
|
||||
tmpFile = `data/chatgpt/tts/tmp/${crypto.randomUUID()}.wav`
|
||||
}
|
||||
if (ignoreEncode) {
|
||||
return segment.record(recordUrl)
|
||||
}
|
||||
let result
|
||||
if (pcm2slk) {
|
||||
result = await getPttBuffer(recordUrl, Bot.config.ffmpeg_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue