feat: add Minimax Speech as alternative TTS provider for Reels

- Add minimax_config table (migration + schema + storage CRUD)
- Add GET/POST /api/minimax/config routes
- Pass tts_provider + minimax_api_key through ffmpeg service
- Add generate_tts_minimax() in Python using Minimax T2A v2 API
- Fall back to ffsubsync for subtitle sync (no WordBoundary events)
- Add Minimax config card in Settings page
- Add provider toggle (Edge TTS / Minimax) + French voices in new-reel
This commit is contained in:
Michael committed 2026-05-18 11:55:07 +02:00
1 parent 9932561050
commit b7ef4940f7
9 files changed
+364 -29

No files matched your search

+16 -2
View File
@@ -13,6 +13,8 @@ interface FFmpegReelRequest {
music_url?: string; // OU URL directe de la musique
tts_enabled?: boolean; // Activation du TTS
tts_voice?: string; // Voix TTS (ex: fr-FR-VivienneNeural)
tts_provider?: string; // Provider TTS: "edge_tts" (défaut) ou "minimax"
minimax_api_key?: string; // Clé API Minimax (requis si tts_provider=minimax)
word_duration?: number; // Durée par mot (default: 0.6s)
font_size?: number; // Taille police (default: 24)
music_volume?: number; // Volume musique (default: 0.25)
@@ -71,6 +73,8 @@ export class FFmpegService {
musicUrl?: string;
ttsEnabled?: boolean;
ttsVoice?: string;
ttsProvider?: string;
minimaxApiKey?: string;
wordDuration?: number;
fontSize?: number;
musicVolume?: number;
@@ -90,6 +94,8 @@ export class FFmpegService {
music_url: options.musicUrl,
tts_enabled: options.ttsEnabled,
tts_voice: options.ttsVoice,
tts_provider: options.ttsProvider,
minimax_api_key: options.minimaxApiKey,
word_duration: options.wordDuration ?? 0.6,
font_size: options.fontSize ?? 64,
music_volume: options.musicVolume ?? 0.25,
@@ -172,6 +178,8 @@ export class FFmpegService {
musicUrl?: string;
ttsEnabled?: boolean;
ttsVoice?: string;
ttsProvider?: string;
minimaxApiKey?: string;
wordDuration?: number;
fontSize?: number;
musicVolume?: number;
@@ -191,6 +199,8 @@ export class FFmpegService {
music_url: options.musicUrl,
tts_enabled: options.ttsEnabled,
tts_voice: options.ttsVoice,
tts_provider: options.ttsProvider,
minimax_api_key: options.minimaxApiKey,
word_duration: options.wordDuration ?? 0.6,
font_size: options.fontSize ?? 64,
music_volume: options.musicVolume ?? 0.25,
@@ -285,7 +295,9 @@ export class FFmpegService {
}
async previewTTS(
text: string,
voice: string
voice: string,
ttsProvider?: string,
minimaxApiKey?: string
): Promise<{ success: boolean; audioBase64?: string; error?: string }> {
const config = this.ensureConfigured();
@@ -298,7 +310,9 @@ export class FFmpegService {
},
body: JSON.stringify({
text,
tts_voice: voice
tts_voice: voice,
tts_provider: ttsProvider,
minimax_api_key: minimaxApiKey,
}),
});