Spaces:
Running
on
T4
Running
on
T4
Commit
•
b6d7cbe
1
Parent(s):
c34843b
int 16
Browse files
app.py
CHANGED
@@ -89,7 +89,7 @@ def response(audio: tuple[int, np.ndarray], conversation: list[dict], img: str |
|
|
89 |
audio_data = frame.split(b'\r\n\r\n', 1)[1]
|
90 |
# audio_data = base64.b64decode(audio_data)
|
91 |
output_audio_bytes += audio_data
|
92 |
-
audio_array = np.frombuffer(audio_data, dtype=np.
|
93 |
yield (OUT_RATE, audio_array, "mono")
|
94 |
elif b'Content-Type: text/plain' in frame:
|
95 |
text_data = frame.split(b'\r\n\r\n', 1)[1].decode()
|
|
|
89 |
audio_data = frame.split(b'\r\n\r\n', 1)[1]
|
90 |
# audio_data = base64.b64decode(audio_data)
|
91 |
output_audio_bytes += audio_data
|
92 |
+
audio_array = np.frombuffer(audio_data, dtype=np.int16).reshape(1, -1)
|
93 |
yield (OUT_RATE, audio_array, "mono")
|
94 |
elif b'Content-Type: text/plain' in frame:
|
95 |
text_data = frame.split(b'\r\n\r\n', 1)[1].decode()
|