Revert "feat: switch to client-side fetch for Fish Audio API to bypass server network restrictions"

This reverts commit dedb37e22b.
This commit is contained in:
2026-08-01 17:49:57 +08:00
parent dedb37e22b
commit 038662c15e
3 changed files with 52 additions and 127 deletions
-19
View File
@@ -2464,25 +2464,6 @@ async function generateTtsWavToTemp(text, reference_id, model = DEFAULT_TTS_MODE
return { tempName, tempPath, url: `/uploads/${tempName}` };
}
app.post('/api/tts/upload_temp', upload.single('audio'), (req, res) => {
try {
if (!req.file) return res.status(400).json({ success: false, message: 'No audio file uploaded' });
const tempName = `temp_${Date.now()}_${Math.floor(Math.random() * 1000)}.wav`;
const tempPath = path.join(uploadDir, tempName);
fs.renameSync(req.file.path, tempPath);
res.json({
success: true,
tempName: tempName,
url: `/uploads/${tempName}`
});
} catch (e) {
res.status(500).json({ success: false, message: e.message });
}
});
app.post('/api/tts/generate', express.json(), async (req, res) => {
const text = String(req.body?.text || '').trim();
const reference_id = String(req.body?.reference_id || '').trim();