Spaces:
Sleeping
Sleeping
Update conver.py
Browse files
conver.py
CHANGED
|
@@ -174,17 +174,19 @@ class URLToAudioConverter:
|
|
| 174 |
return final_output, conversation_text
|
| 175 |
|
| 176 |
async def raw_text_to_audio(self, text: str, voice_1: str, voice_2: str) -> Tuple[str, str]:
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
|
|
|
|
|
|
| 188 |
|
| 189 |
def clean_old_files(self, max_age_seconds=86400):
|
| 190 |
"""
|
|
|
|
| 174 |
return final_output, conversation_text
|
| 175 |
|
| 176 |
async def raw_text_to_audio(self, text: str, voice_1: str, voice_2: str) -> Tuple[str, str]:
|
| 177 |
+
"""Modo sin LLM (texto directo), convierte el texto en conversación simple y genera audio."""
|
| 178 |
+
conversation = {
|
| 179 |
+
"conversation": [
|
| 180 |
+
{"speaker": "Host", "text": text},
|
| 181 |
+
{"speaker": "Co-host", "text": "(Continuación del tema)"}
|
| 182 |
+
]
|
| 183 |
+
}
|
| 184 |
+
audio_files, folder_name = await self.text_to_speech(conversation, voice_1, voice_2)
|
| 185 |
+
output_file = os.path.join(folder_name, "raw_podcast.mp3")
|
| 186 |
+
self.combine_audio_files(audio_files, output_file)
|
| 187 |
+
# DEVUELVE (ruta_audio, texto) para que Gradio lo use bien
|
| 188 |
+
return output_file, text
|
| 189 |
+
|
| 190 |
|
| 191 |
def clean_old_files(self, max_age_seconds=86400):
|
| 192 |
"""
|