Spaces:
Sleeping
Sleeping
Update conver.py
Browse files
conver.py
CHANGED
|
@@ -165,20 +165,17 @@ class URLToAudioConverter:
|
|
| 165 |
os.remove(f)
|
| 166 |
return final_output, conversation_text
|
| 167 |
|
| 168 |
-
async def
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
for f in audio_files:
|
| 183 |
-
os.remove(f)
|
| 184 |
-
return text, output_file
|
|
|
|
| 165 |
os.remove(f)
|
| 166 |
return final_output, conversation_text
|
| 167 |
|
| 168 |
+
async def generate_podcast(self, conversation, voice_1, voice_2):
|
| 169 |
+
folder_name = await self.text_to_speech(conversation, voice_1, voice_2)
|
| 170 |
+
combined_audio = self.combine_audio_files(audio_files)
|
| 171 |
+
music_path = "musica.mp3" # Archivo en root (sin 'assets/')
|
| 172 |
+
tags_paths = ["tag.mp3", "tag2.mp3"] # Archivos en root
|
| 173 |
+
final_audio = self.add_background_music_and_tags(combined_audio, music_path, tags_paths)
|
| 174 |
+
output_file = os.path.join(folder_name, "raw_podcast_with_music.mp3")
|
| 175 |
+
final_audio.export(output_file, format="mp3")
|
| 176 |
+
|
| 177 |
+
# Limpieza de archivos temporales
|
| 178 |
+
for f in audio_files:
|
| 179 |
+
os.remove(f)
|
| 180 |
+
|
| 181 |
+
return text, output_file # Ahora el return está DENTRO de la función
|
|
|
|
|
|
|
|
|