Spaces:
Running
Running
PerryCheng614
commited on
Commit
•
9915f17
1
Parent(s):
f078c1f
change to wss
Browse files- app.py +1 -4
- gradio_audio_bytes.txt +0 -0
app.py
CHANGED
@@ -17,12 +17,9 @@ async def process_audio_stream(audio_path, max_tokens):
|
|
17 |
with open(audio_path, 'rb') as f:
|
18 |
audio_bytes = f.read()
|
19 |
base64_bytes = base64.b64encode(audio_bytes)
|
20 |
-
# Keep as bytes - don't decode to string
|
21 |
-
|
22 |
-
print(base64_bytes) # For debugging
|
23 |
|
24 |
# Connect to WebSocket
|
25 |
-
async with websockets.connect('
|
26 |
# Send binary base64 audio data as bytes
|
27 |
await websocket.send(base64_bytes) # Send the raw base64 bytes
|
28 |
|
|
|
17 |
with open(audio_path, 'rb') as f:
|
18 |
audio_bytes = f.read()
|
19 |
base64_bytes = base64.b64encode(audio_bytes)
|
|
|
|
|
|
|
20 |
|
21 |
# Connect to WebSocket
|
22 |
+
async with websockets.connect('wss://nexa-omni.nexa4ai.com/ws/process-audio/') as websocket:
|
23 |
# Send binary base64 audio data as bytes
|
24 |
await websocket.send(base64_bytes) # Send the raw base64 bytes
|
25 |
|
gradio_audio_bytes.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|