mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-19 21:18:18 +02:00
Fix sync-info route to use ttsEngine and ttsVoice
- ttsSyncService.calculateSyncTiming now accepts ttsEngine parameter - sync-info route extracts ttsVoice/ttsEngine from req.body instead of voice - Previously it always fell back to Edge TTS even when Gemini was selected (because server stored 'fr-FR-Standard-B' but route only used 'voice')
This commit is contained in:
1 parent
6ff8f6b283
commit
a9cda4ffd4
2 files changed
+5
-5
No files matched your search
@@ -15,11 +15,11 @@ export class TtsSyncService {
|
||||
* Calcule le word_duration optimal pour synchroniser l'affichage du texte
|
||||
* avec la durée réelle de la voix TTS générée.
|
||||
*/
|
||||
async calculateSyncTiming(text: string, voice: string): Promise<SyncTiming> {
|
||||
async calculateSyncTiming(text: string, voice: string, ttsEngine?: string): Promise<SyncTiming> {
|
||||
const cleanText = this.cleanText(text);
|
||||
|
||||
// 1. Générer le TTS preview et mesurer sa durée exacte
|
||||
const ttsResult = await ffmpegService.previewTTS(cleanText, voice);
|
||||
const ttsResult = await ffmpegService.previewTTS(cleanText, voice, ttsEngine);
|
||||
if (!ttsResult.success || !ttsResult.audioBase64) {
|
||||
throw new Error('TTS preview failed: ' + (ttsResult.error || 'unknown'));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user