Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -139,21 +139,21 @@ def process_input(text, txt_file, mp3_file, selected_voice, rate, pitch, keyword
|
|
139 |
elif txt_file is not None:
|
140 |
final_text = txt_file.decode("utf-8")
|
141 |
else:
|
142 |
-
return
|
143 |
|
144 |
voices = asyncio.run(get_voices())
|
145 |
if selected_voice not in voices:
|
146 |
-
return
|
147 |
|
148 |
try:
|
149 |
audio_file = asyncio.run(text_to_speech(final_text, selected_voice, rate, pitch))
|
150 |
except Exception as e:
|
151 |
-
return
|
152 |
|
153 |
try:
|
154 |
video_clip = concatenate_pixabay_videos(keywords, num_videos_per_keyword=1)
|
155 |
except Exception as e:
|
156 |
-
return
|
157 |
|
158 |
if mp3_file is not None:
|
159 |
music_clip = adjust_background_music(video_clip.duration, mp3_file.name)
|
@@ -165,7 +165,7 @@ def process_input(text, txt_file, mp3_file, selected_voice, rate, pitch, keyword
|
|
165 |
return final_video_path
|
166 |
|
167 |
except Exception as e:
|
168 |
-
return
|
169 |
|
170 |
def upload_to_google_drive(file_path):
|
171 |
try:
|
|
|
139 |
elif txt_file is not None:
|
140 |
final_text = txt_file.decode("utf-8")
|
141 |
else:
|
142 |
+
return None
|
143 |
|
144 |
voices = asyncio.run(get_voices())
|
145 |
if selected_voice not in voices:
|
146 |
+
return None
|
147 |
|
148 |
try:
|
149 |
audio_file = asyncio.run(text_to_speech(final_text, selected_voice, rate, pitch))
|
150 |
except Exception as e:
|
151 |
+
return None
|
152 |
|
153 |
try:
|
154 |
video_clip = concatenate_pixabay_videos(keywords, num_videos_per_keyword=1)
|
155 |
except Exception as e:
|
156 |
+
return None
|
157 |
|
158 |
if mp3_file is not None:
|
159 |
music_clip = adjust_background_music(video_clip.duration, mp3_file.name)
|
|
|
165 |
return final_video_path
|
166 |
|
167 |
except Exception as e:
|
168 |
+
return None
|
169 |
|
170 |
def upload_to_google_drive(file_path):
|
171 |
try:
|