Spaces:
Sleeping
Sleeping
Update api/audio.py
Browse files- api/audio.py +7 -1
api/audio.py
CHANGED
|
@@ -335,10 +335,16 @@ class TTSManager:
|
|
| 335 |
else:
|
| 336 |
raise APIError(f"TTS Error: Unsupported TTS type: {self.config.tts.type}")
|
| 337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
response = requests.post(url, headers=headers, json=data)
|
|
|
|
|
|
|
| 339 |
if response.status_code != 200:
|
| 340 |
error_details = response.json().get("error", "No error message provided")
|
| 341 |
-
raise APIError(f"TTS Error: {self.config.tts.type} error", status_code=response.status_code, details=error_details)
|
| 342 |
yield response.content
|
| 343 |
|
| 344 |
def _read_text_stream(self, headers: dict, data: dict) -> Generator[bytes, None, None]:
|
|
|
|
| 335 |
else:
|
| 336 |
raise APIError(f"TTS Error: Unsupported TTS type: {self.config.tts.type}")
|
| 337 |
|
| 338 |
+
print(url)
|
| 339 |
+
print(header)
|
| 340 |
+
print(json)
|
| 341 |
+
|
| 342 |
response = requests.post(url, headers=headers, json=data)
|
| 343 |
+
|
| 344 |
+
|
| 345 |
if response.status_code != 200:
|
| 346 |
error_details = response.json().get("error", "No error message provided")
|
| 347 |
+
#raise APIError(f"TTS Error: {self.config.tts.type} error", status_code=response.status_code, details=error_details)
|
| 348 |
yield response.content
|
| 349 |
|
| 350 |
def _read_text_stream(self, headers: dict, data: dict) -> Generator[bytes, None, None]:
|