mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-13 14:25:17 +03:00
fix(web-test): limit ElevenLabs TTS concurrency to 2 and improve error logging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2714,7 +2714,7 @@ export async function addNarration(videoPath, opts = {}) {
|
|||||||
try {
|
try {
|
||||||
// Phase 1: Generate TTS audio for each caption
|
// Phase 1: Generate TTS audio for each caption
|
||||||
const ttsFiles = [];
|
const ttsFiles = [];
|
||||||
const BATCH_SIZE = 5;
|
const BATCH_SIZE = (opts.provider === 'elevenlabs') ? 2 : 5;
|
||||||
for (let batchStart = 0; batchStart < captions.length; batchStart += BATCH_SIZE) {
|
for (let batchStart = 0; batchStart < captions.length; batchStart += BATCH_SIZE) {
|
||||||
const batch = captions.slice(batchStart, batchStart + BATCH_SIZE);
|
const batch = captions.slice(batchStart, batchStart + BATCH_SIZE);
|
||||||
const promises = batch.map(async (cap, batchIdx) => {
|
const promises = batch.map(async (cap, batchIdx) => {
|
||||||
@@ -2727,7 +2727,7 @@ export async function addNarration(videoPath, opts = {}) {
|
|||||||
try {
|
try {
|
||||||
await ttsProvider(cap.speech, ttsFile, ttsOpts);
|
await ttsProvider(cap.speech, ttsFile, ttsOpts);
|
||||||
} catch (retryErr) {
|
} catch (retryErr) {
|
||||||
warnings.push(`TTS failed for caption ${idx}: ${retryErr.message}`);
|
warnings.push(`TTS failed for caption ${idx}: ${retryErr.message || retryErr.cause?.message || String(retryErr)}`);
|
||||||
// Generate 1s silence as placeholder
|
// Generate 1s silence as placeholder
|
||||||
generateSilence(ttsFile, 1, ffmpegPath);
|
generateSilence(ttsFile, 1, ffmpegPath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user