Spaces:
Running
Running
Update generate_audio_edgetts.py
Browse files
generate_audio_edgetts.py
CHANGED
@@ -49,7 +49,8 @@ class EdgeTTSGenerator:
|
|
49 |
communicator = edge_tts.Communicate(text, voice_name)
|
50 |
audio_bytes = b""
|
51 |
async for chunk in communicator.stream():
|
52 |
-
|
|
|
53 |
return audio_bytes
|
54 |
|
55 |
def save_audio(self, audio_data):
|
|
|
49 |
communicator = edge_tts.Communicate(text, voice_name)
|
50 |
audio_bytes = b""
|
51 |
async for chunk in communicator.stream():
|
52 |
+
if "data" in chunk: # Check if 'data' exists in chunk
|
53 |
+
audio_bytes += chunk["data"] # Concatenate only the audio data
|
54 |
return audio_bytes
|
55 |
|
56 |
def save_audio(self, audio_data):
|