Spaces:
Sleeping
Sleeping
hashhac
commited on
Commit
·
3f38c72
1
Parent(s):
35e9187
fixed it yahoo
Browse files
app.py
CHANGED
@@ -104,8 +104,6 @@ def text_to_speech(text):
|
|
104 |
# Make sure speech is float32 before any conversion to avoid the error
|
105 |
audio_array = speech.cpu().numpy().astype(np.float32)
|
106 |
|
107 |
-
# Normalize and convert to int16 for output
|
108 |
-
audio_array = (audio_array / np.max(np.abs(audio_array) + 1e-6) * 32767).astype(np.int16)
|
109 |
|
110 |
# Reshape for fastrtc
|
111 |
audio_array = audio_array.reshape(1, -1)
|
|
|
104 |
# Make sure speech is float32 before any conversion to avoid the error
|
105 |
audio_array = speech.cpu().numpy().astype(np.float32)
|
106 |
|
|
|
|
|
107 |
|
108 |
# Reshape for fastrtc
|
109 |
audio_array = audio_array.reshape(1, -1)
|