mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
fix: reduce font size to 16, improve TTS sync (3 words/chunk, 0.3s/word)
This commit is contained in:
1 parent
3ce30e71f0
commit
fe638b9895
3 files changed
+6
-6
No files matched your search
@@ -117,7 +117,7 @@ def generate_simple_vtt(text: str, vtt_path: Path):
|
|||||||
|
|
||||||
for word in words:
|
for word in words:
|
||||||
current_chunk.append(word)
|
current_chunk.append(word)
|
||||||
if len(current_chunk) >= 5 or word.endswith((".", "!", "?", ":")):
|
if len(current_chunk) >= 3 or word.endswith((".", "!", "?", ":")):
|
||||||
chunks.append(" ".join(current_chunk))
|
chunks.append(" ".join(current_chunk))
|
||||||
current_chunk = []
|
current_chunk = []
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ def generate_simple_vtt(text: str, vtt_path: Path):
|
|||||||
|
|
||||||
for i, chunk in enumerate(chunks):
|
for i, chunk in enumerate(chunks):
|
||||||
word_count = len(chunk.split())
|
word_count = len(chunk.split())
|
||||||
duration = word_count * 0.4 # 0.4 seconds per word
|
duration = word_count * 0.3 # 0.3 seconds per word (faster sync)
|
||||||
|
|
||||||
start_time = format_vtt_time(current_time)
|
start_time = format_vtt_time(current_time)
|
||||||
end_time = format_vtt_time(current_time + duration)
|
end_time = format_vtt_time(current_time + duration)
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ reelsRouter.post('/reels/preview', async (req: Request, res: Response) => {
|
|||||||
ttsEnabled,
|
ttsEnabled,
|
||||||
ttsVoice,
|
ttsVoice,
|
||||||
wordDuration = 0.6,
|
wordDuration = 0.6,
|
||||||
fontSize = 24,
|
fontSize = 16,
|
||||||
musicVolume = 0.25,
|
musicVolume = 0.25,
|
||||||
drawText = true,
|
drawText = true,
|
||||||
} = req.body;
|
} = req.body;
|
||||||
@@ -255,7 +255,7 @@ reelsRouter.post('/reels', async (req: Request, res: Response) => {
|
|||||||
pageIds,
|
pageIds,
|
||||||
scheduledFor,
|
scheduledFor,
|
||||||
wordDuration = 0.6,
|
wordDuration = 0.6,
|
||||||
fontSize = 24,
|
fontSize = 16,
|
||||||
musicVolume = 0.25,
|
musicVolume = 0.25,
|
||||||
drawText = true,
|
drawText = true,
|
||||||
} = req.body;
|
} = req.body;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export class FFmpegService {
|
|||||||
tts_enabled: options.ttsEnabled,
|
tts_enabled: options.ttsEnabled,
|
||||||
tts_voice: options.ttsVoice,
|
tts_voice: options.ttsVoice,
|
||||||
word_duration: options.wordDuration ?? 0.6,
|
word_duration: options.wordDuration ?? 0.6,
|
||||||
font_size: options.fontSize ?? 24,
|
font_size: options.fontSize ?? 16,
|
||||||
music_volume: options.musicVolume ?? 0.25,
|
music_volume: options.musicVolume ?? 0.25,
|
||||||
draw_text: options.drawText ?? true,
|
draw_text: options.drawText ?? true,
|
||||||
};
|
};
|
||||||
@@ -176,7 +176,7 @@ export class FFmpegService {
|
|||||||
tts_enabled: options.ttsEnabled,
|
tts_enabled: options.ttsEnabled,
|
||||||
tts_voice: options.ttsVoice,
|
tts_voice: options.ttsVoice,
|
||||||
word_duration: options.wordDuration ?? 0.6,
|
word_duration: options.wordDuration ?? 0.6,
|
||||||
font_size: options.fontSize ?? 24,
|
font_size: options.fontSize ?? 16,
|
||||||
music_volume: options.musicVolume ?? 0.25,
|
music_volume: options.musicVolume ?? 0.25,
|
||||||
draw_text: options.drawText ?? true,
|
draw_text: options.drawText ?? true,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user