Spaces:
Running
Running
Update conver.py
Browse files
conver.py
CHANGED
@@ -76,10 +76,10 @@ class URLToAudioConverter:
|
|
76 |
raise RuntimeError(f"Failed to parse dialogue: {str(e)}")
|
77 |
|
78 |
async def text_to_speech(self, conversation_json: Dict, voice_1: str, voice_2: str) -> Tuple[List[str], str]:
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
raise ValueError("No conversation data to process")
|
84 |
for i, turn in enumerate(conversation_json["conversation"]):
|
85 |
filename = output_dir / f"segment_{i}.mp3"
|
|
|
76 |
raise RuntimeError(f"Failed to parse dialogue: {str(e)}")
|
77 |
|
78 |
async def text_to_speech(self, conversation_json: Dict, voice_1: str, voice_2: str) -> Tuple[List[str], str]:
|
79 |
+
output_dir = Path(self._create_output_directory())
|
80 |
+
filenames = []
|
81 |
+
try:
|
82 |
+
if not conversation_json["conversation"]:
|
83 |
raise ValueError("No conversation data to process")
|
84 |
for i, turn in enumerate(conversation_json["conversation"]):
|
85 |
filename = output_dir / f"segment_{i}.mp3"
|