From 9ffd92f6bf1c13e580f504043a364293a71be4f9 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Thu, 22 Jan 2026 15:28:00 +0100 Subject: [PATCH] add TTS voice --- client/src/pages/new-reel.tsx | 63 +++++++++++++++- ffmpeg-service/main.py | 138 ++++++++++++++++++++++++++++++---- server/routes/reels.ts | 9 +++ server/services/ffmpeg.ts | 12 +++ task.md | 7 ++ 5 files changed, 214 insertions(+), 15 deletions(-) diff --git a/client/src/pages/new-reel.tsx b/client/src/pages/new-reel.tsx index e5f4aed..b210da2 100644 --- a/client/src/pages/new-reel.tsx +++ b/client/src/pages/new-reel.tsx @@ -4,7 +4,7 @@ import { useLocation } from "wouter"; import { Send, Sparkles, Video, Music, Type, Calendar, Upload, Camera, Play, Pause, Volume2, VolumeX, - ChevronRight, Loader2, Check, RefreshCw + ChevronRight, Loader2, Check, RefreshCw, Mic } from "lucide-react"; import { useDropzone } from "react-dropzone"; import Sidebar from "@/components/sidebar"; @@ -14,8 +14,18 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com import { Textarea } from "@/components/ui/textarea"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; import { Checkbox } from "@/components/ui/checkbox"; +import { Switch } from "@/components/ui/switch"; import { Slider } from "@/components/ui/slider"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { useToast } from "@/hooks/use-toast"; import { apiRequest, queryClient } from "@/lib/queryClient"; import type { SocialPage, Media } from "@shared/schema"; @@ -55,7 +65,10 @@ export default function NewReel() { const [generatedVariants, setGeneratedVariants] = useState([]); const [selectedPages, setSelectedPages] = useState([]); const [scheduledDate, setScheduledDate] = useState(undefined); + const [scheduledDate, setScheduledDate] = useState(undefined); const [musicVolume, setMusicVolume] = useState([25]); + const [ttsEnabled, setTtsEnabled] = useState(false); + const [ttsVoice, setTtsVoice] = useState("female"); // État audio preview const [isPlaying, setIsPlaying] = useState(null); @@ -298,6 +311,8 @@ export default function NewReel() { pageIds: selectedPages, scheduledFor: scheduledDate?.toISOString(), musicVolume: musicVolume[0] / 100, + ttsEnabled, + ttsVoice, }); }; @@ -685,6 +700,52 @@ export default function NewReel() { rows={4} /> +
+ + +
+ + {ttsEnabled && ( +
+ +
+
setTtsVoice("female")} + className={`cursor-pointer p-3 rounded-md border-2 text-center transition-all ${ttsVoice === 'female' + ? 'border-primary bg-primary/10' + : 'border-transparent bg-background hover:bg-accent' + }`} + > +
Féminine
+
Vivienne
+
+
setTtsVoice("male")} + className={`cursor-pointer p-3 rounded-md border-2 text-center transition-all ${ttsVoice === 'male' + ? 'border-primary bg-primary/10' + : 'border-transparent bg-background hover:bg-accent' + }`} + > +
Masculine
+
Rémy
+
+
+

+ Le texte sera automatiquement synchronisé avec la voix. + Les #hashtags et émojis ne seront pas lus. +

+
+ )} +