refactor: remove Piper TTS, keep edge_tts only

- Remove piper_url from ReelRequest model and all function signatures
- Remove generate_tts_piper() function and Piper branch in generate_tts_with_subs()
- Remove /api/piper/config routes from server/routes.ts
- Remove piperConfig table, schemas and storage methods
- Remove piper_config migration
- Remove Piper TTS settings UI card
- Update "Piper TTS" labels to "TTS — voix activée"

edge_tts is now the only TTS engine, using precise word-boundary timing
This commit is contained in:
Michael committed 2026-05-19 10:55:01 +02:00
1 parent 8736e4f6a0
commit 59bc56aedc
12 files changed
+46 -265

No files matched your search

+1 -1
View File
@@ -448,7 +448,7 @@ export default function MobileNewReel() {
<div className="mt-4 space-y-2 ml-1 p-3 bg-muted/30 rounded-lg border border-border/50">
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<Mic className="w-4 h-4" />
<span>Piper TTS — voix configurée sur le serveur</span>
<span>TTS — voix activée</span>
</div>
<div className="mt-3">
<Button
+1 -1
View File
@@ -311,7 +311,7 @@ export default function MobileRemotionVideoPage() {
</div>
{ttsEnabled && (
<div className="space-y-2">
<p className="text-xs text-muted-foreground">Piper TTS — voix configurée sur le serveur</p>
<p className="text-xs text-muted-foreground">TTS — voix activée</p>
<Button size="sm" variant="outline" className="w-full" onClick={handleTtsPreview} disabled={!overlayText}>
<Volume2 className="mr-2 w-3 h-3" /> Écouter la voix
</Button>
+1 -1
View File
@@ -762,7 +762,7 @@ export default function NewReel() {
<div className="mt-4 space-y-2 ml-12 p-4 bg-muted/30 rounded-lg border border-border/50">
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<Mic className="w-4 h-4" />
<span>Piper TTS — voix configurée sur le serveur</span>
<span>TTS — voix activée</span>
</div>
<div className="mt-3 flex gap-2">
+1 -1
View File
@@ -252,7 +252,7 @@ export default function RemotionVideoPage() {
</div>
{ttsEnabled && (
<div className="space-y-3 p-3 bg-muted/30 rounded-lg border">
<p className="text-sm text-muted-foreground">Piper TTS — voix configurée sur le serveur</p>
<p className="text-sm text-muted-foreground">TTS — voix activée</p>
<Button size="sm" variant="outline" className="w-full" onClick={handleTtsPreview} disabled={!overlayText}>
<Volume2 className="mr-2 w-3 h-3" /> Écouter la voix
</Button>
-72
View File
@@ -30,7 +30,6 @@ export default function Settings() {
const [ffmpegApiUrl, setFfmpegApiUrl] = useState("");
const [ffmpegApiKey, setFfmpegApiKey] = useState("");
const [externalApiKey, setExternalApiKey] = useState("");
const [piperUrl, setPiperUrl] = useState("");
const { toast } = useToast();
const { data: session } = useQuery<{ id: string; username: string; role: string }>({
@@ -61,10 +60,6 @@ export default function Settings() {
enabled: isAdmin,
});
const { data: piperConfig } = useQuery({
queryKey: ['/api/piper/config'],
});
useEffect(() => {
if (cloudinaryConfig) {
setCloudName((cloudinaryConfig as any).cloudName || "");
@@ -78,12 +73,6 @@ export default function Settings() {
}
}, [cloudinaryConfig]);
useEffect(() => {
if (piperConfig) {
setPiperUrl((piperConfig as any).url || "");
}
}, [piperConfig]);
useEffect(() => {
if (openrouterConfig) {
setOpenrouterModel((openrouterConfig as any).model || "anthropic/claude-3.5-sonnet");
@@ -224,27 +213,6 @@ export default function Settings() {
});
const hasExistingExternalApiConfig = !!(externalApiConfig as any)?.configured;
const hasExistingPiperConfig = !!(piperConfig as any)?.url;
const savePiperMutation = useMutation({
mutationFn: () => {
return apiRequest('POST', '/api/piper/config', { url: piperUrl });
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['/api/piper/config'] });
toast({
title: "Configuration sauvegardée",
description: "L'URL du serveur Piper TTS a été enregistrée",
});
},
onError: () => {
toast({
title: "Erreur",
description: "Impossible de sauvegarder la configuration Piper",
variant: "destructive",
});
},
});
const saveExternalApiMutation = useMutation({
mutationFn: () => apiRequest('POST', '/api/settings/external-api', { apiKey: externalApiKey }),
@@ -493,46 +461,6 @@ export default function Settings() {
</Card>
)}
<Card className="rounded-2xl border-border/50 shadow-lg">
<CardHeader className="p-6">
<CardTitle className="flex items-center gap-2">
<Mic className="w-5 h-5" />
Configuration Piper TTS (Voix)
</CardTitle>
<CardDescription>
Configurez l'URL de votre serveur Piper TTS pour la synthèse vocale des Reels
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="space-y-2">
<Label htmlFor="piperUrl">URL du serveur Piper</Label>
<Input
id="piperUrl"
type="url"
value={piperUrl}
onChange={(e) => setPiperUrl(e.target.value)}
placeholder="http://piper-server:5000/api/tts"
data-testid="input-piper-url"
/>
<p className="text-xs text-muted-foreground">
{hasExistingPiperConfig ? (
<span className="text-green-600 dark:text-green-400">✓ Configuré</span>
) : (
"URL de l'endpoint HTTP GET de votre serveur Piper (ex: http://piper:5000/api/tts)"
)}
</p>
</div>
<Button
onClick={() => savePiperMutation.mutate()}
disabled={savePiperMutation.isPending || !piperUrl.trim()}
data-testid="button-save-piper"
className="w-full"
>
{savePiperMutation.isPending ? "Enregistrement..." : "Enregistrer Piper TTS"}
</Button>
</CardContent>
</Card>
<Card className="rounded-2xl border-border/50 shadow-lg">
<CardHeader className="p-6">
<CardTitle className="flex items-center gap-2">