Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,6 +70,7 @@ def text_to_video(text, voice, rate, pitch, video_width, video_height, bg_color,
|
|
70 |
audio_clip = AudioFileClip(audio)
|
71 |
audio_clips.append(audio_clip)
|
72 |
|
|
|
73 |
# 使用 wand 生成视频片段
|
74 |
with Drawing() as draw:
|
75 |
draw.font = font_path
|
@@ -82,7 +83,8 @@ def text_to_video(text, voice, rate, pitch, video_width, video_height, bg_color,
|
|
82 |
lines = page.split("\n")
|
83 |
for j, line in enumerate(lines):
|
84 |
draw.text(int(video_width / 2), (j + 1) * (text_size + 10), line)
|
85 |
-
|
|
|
86 |
img.format = 'png'
|
87 |
img_path = os.path.join(tempfile.gettempdir(), f"page_{i}.png")
|
88 |
img.save(filename=img_path)
|
|
|
70 |
audio_clip = AudioFileClip(audio)
|
71 |
audio_clips.append(audio_clip)
|
72 |
|
73 |
+
# 使用 wand 生成视频片段
|
74 |
# 使用 wand 生成视频片段
|
75 |
with Drawing() as draw:
|
76 |
draw.font = font_path
|
|
|
83 |
lines = page.split("\n")
|
84 |
for j, line in enumerate(lines):
|
85 |
draw.text(int(video_width / 2), (j + 1) * (text_size + 10), line)
|
86 |
+
|
87 |
+
draw(img) # Apply the drawing to the image
|
88 |
img.format = 'png'
|
89 |
img_path = os.path.join(tempfile.gettempdir(), f"page_{i}.png")
|
90 |
img.save(filename=img_path)
|