gnosticdev commited on
Commit
123b465
·
verified ·
1 Parent(s): aef08e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 "No input provided"
143
 
144
  voices = asyncio.run(get_voices())
145
  if selected_voice not in voices:
146
- return f"La voz '{selected_voice}' no es válida. Por favor, seleccione una de las siguientes voces: {', '.join(voices.keys())}"
147
 
148
  try:
149
  audio_file = asyncio.run(text_to_speech(final_text, selected_voice, rate, pitch))
150
  except Exception as e:
151
- return f"Error generando audio: {e}"
152
 
153
  try:
154
  video_clip = concatenate_pixabay_videos(keywords, num_videos_per_keyword=1)
155
  except Exception as e:
156
- return f"Error concatenando videos: {e}"
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 f"Error durante el procesamiento: {e}"
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: