mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-24 15:38:10 +02:00
feat: emoji support in subtitles and clear stabilization UI
This commit is contained in:
1 parent
eee6e65c94
commit
817bd2a980
3 files changed
+25
-8
No files matched your search
@@ -84,7 +84,6 @@ export default function MobileNewReel() {
|
|||||||
const [isPlaying, setIsPlaying] = useState<string | null>(null);
|
const [isPlaying, setIsPlaying] = useState<string | null>(null);
|
||||||
const [musicOffset, setMusicOffset] = useState(0);
|
const [musicOffset, setMusicOffset] = useState(0);
|
||||||
const [stabilize, setStabilize] = useState(true); // Activé par défaut pour les Reels
|
const [stabilize, setStabilize] = useState(true); // Activé par défaut pour les Reels
|
||||||
const [force1080p, setForce1080p] = useState(true); // Activé par défaut
|
|
||||||
|
|
||||||
|
|
||||||
const { data: pages = [] } = useQuery<SocialPage[]>({
|
const { data: pages = [] } = useQuery<SocialPage[]>({
|
||||||
@@ -277,9 +276,9 @@ export default function MobileNewReel() {
|
|||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<div className="text-sm font-medium flex items-center gap-2">
|
<div className="text-sm font-medium flex items-center gap-2">
|
||||||
<Sparkles className="w-4 h-4 text-primary" /> Stabilisation & Qualité 1080p
|
<Sparkles className="w-4 h-4 text-primary" /> Stabilisation Vidéo (Anti-tremblements)
|
||||||
</div>
|
</div>
|
||||||
<div className="text-xs text-muted-foreground">Application automatique après capture</div>
|
<div className="text-xs text-muted-foreground">Corrige les secousses (Recommandé main levée). Désactiver sur trépied.</div>
|
||||||
</div>
|
</div>
|
||||||
<Switch
|
<Switch
|
||||||
checked={stabilize}
|
checked={stabilize}
|
||||||
|
|||||||
+21
-5
@@ -122,7 +122,11 @@ def clean_text_for_tts(text: str) -> str:
|
|||||||
|
|
||||||
|
|
||||||
async def generate_tts_with_subs(
|
async def generate_tts_with_subs(
|
||||||
text: str, voice: str, audio_path: Path, ass_path: Path
|
text: str,
|
||||||
|
voice: str,
|
||||||
|
audio_path: Path,
|
||||||
|
ass_path: Path,
|
||||||
|
display_text: Optional[str] = None,
|
||||||
):
|
):
|
||||||
"""Generate TTS audio with subtitles, with retry and fallback voices."""
|
"""Generate TTS audio with subtitles, with retry and fallback voices."""
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -185,7 +189,11 @@ async def generate_tts_with_subs(
|
|||||||
audio_duration = None
|
audio_duration = None
|
||||||
|
|
||||||
# Generate a high-quality ASS file with sync
|
# Generate a high-quality ASS file with sync
|
||||||
generate_simple_ass(text, ass_path, total_duration=audio_duration)
|
# Use display_text (with emojis) if provided, otherwise standard text
|
||||||
|
text_to_display = display_text if display_text else text
|
||||||
|
generate_simple_ass(
|
||||||
|
text_to_display, ass_path, total_duration=audio_duration
|
||||||
|
)
|
||||||
|
|
||||||
print(f"✅ TTS success with voice: {attempt_voice}")
|
print(f"✅ TTS success with voice: {attempt_voice}")
|
||||||
return # Success!
|
return # Success!
|
||||||
@@ -410,8 +418,13 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)):
|
|||||||
|
|
||||||
if tts_clean_text:
|
if tts_clean_text:
|
||||||
print(f"🔊 Generating TTS audio to: {tts_audio_path}")
|
print(f"🔊 Generating TTS audio to: {tts_audio_path}")
|
||||||
|
# Pass original text (with emojis) for subtitles, cleaned text for audio
|
||||||
await generate_tts_with_subs(
|
await generate_tts_with_subs(
|
||||||
tts_clean_text, voice, tts_audio_path, tts_ass_path
|
tts_clean_text,
|
||||||
|
voice,
|
||||||
|
tts_audio_path,
|
||||||
|
tts_ass_path,
|
||||||
|
display_text=request.text,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Verify files were created
|
# Verify files were created
|
||||||
@@ -421,7 +434,7 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)):
|
|||||||
)
|
)
|
||||||
has_tts = True
|
has_tts = True
|
||||||
else:
|
else:
|
||||||
print(f"❌ TTS audio file missing or empty!")
|
print("❌ TTS audio file missing or empty!")
|
||||||
else:
|
else:
|
||||||
print("⚠️ TTS text is empty after cleaning, skipping.")
|
print("⚠️ TTS text is empty after cleaning, skipping.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -739,7 +752,10 @@ async def preview_tts(request: ReelRequest, x_api_key: str = Header(None)):
|
|||||||
elif not voice or "Neural" not in voice:
|
elif not voice or "Neural" not in voice:
|
||||||
voice = "fr-FR-VivienneMultilingualNeural"
|
voice = "fr-FR-VivienneMultilingualNeural"
|
||||||
|
|
||||||
await generate_tts_with_subs(clean_text, voice, tts_audio_path, tts_srt_path)
|
# Pass original text for subtitles (implied in SRT for preview too if needed, though mostly audio)
|
||||||
|
await generate_tts_with_subs(
|
||||||
|
clean_text, voice, tts_audio_path, tts_srt_path, display_text=request.text
|
||||||
|
)
|
||||||
|
|
||||||
if not tts_audio_path.exists():
|
if not tts_audio_path.exists():
|
||||||
raise Exception("TTS generation failed (file missing)")
|
raise Exception("TTS generation failed (file missing)")
|
||||||
|
|||||||
@@ -112,10 +112,12 @@ Ajout d'une fonctionnalité complète de création de Reels Facebook permettant
|
|||||||
- [x] Fix: Synchronisation parfaite Texte/Voix (TTS dynamique)
|
- [x] Fix: Synchronisation parfaite Texte/Voix (TTS dynamique)
|
||||||
- [x] Fix: Stabilisation optimisée (Zoom adaptatif + Single Pass)
|
- [x] Fix: Stabilisation optimisée (Zoom adaptatif + Single Pass)
|
||||||
- [x] Amélioration: Stabilisation Aggressive (Smoothing 30, Shakiness 10)
|
- [x] Amélioration: Stabilisation Aggressive (Smoothing 30, Shakiness 10)
|
||||||
|
- [x] Fix: Emojis supportés dans le texte (mais ignorés par TTS)
|
||||||
- [x] **Phase 11: Clarification UX Mobile** ✅
|
- [x] **Phase 11: Clarification UX Mobile** ✅
|
||||||
- [x] Modifier l'alerte iOS pour prévenir que les réglages se font après
|
- [x] Modifier l'alerte iOS pour prévenir que les réglages se font après
|
||||||
- [x] Ajouter une flèche ou une animation pour attirer l'œil sur le Switch de stabilisation
|
- [x] Ajouter une flèche ou une animation pour attirer l'œil sur le Switch de stabilisation
|
||||||
- [x] S'assurer que le bouton "Suivant" est bien visible sous le Switch
|
- [x] S'assurer que le bouton "Suivant" est bien visible sous le Switch
|
||||||
|
- [x] Renommer toggle stabilisation pour clarté (Anti-tremblements)
|
||||||
- [x] **Phase 12: Optimisation Safari (Bypass Compression)** ✅
|
- [x] **Phase 12: Optimisation Safari (Bypass Compression)** ✅
|
||||||
- [x] Ajouter l'attribut `multiple` à l'input file pour forcer l'envoi du fichier original (Bypass Safari downscaling)
|
- [x] Ajouter l'attribut `multiple` à l'input file pour forcer l'envoi du fichier original (Bypass Safari downscaling)
|
||||||
- [x] Mettre à jour les MIME types pour inclure `video/quicktime` (iPhone natif)
|
- [x] Mettre à jour les MIME types pour inclure `video/quicktime` (iPhone natif)
|
||||||
|
|||||||
Reference in new issue
Block a user