Luigi commited on
Commit
b7b0486
·
1 Parent(s): 0492452

disable some high freq.debug msg

Browse files
Files changed (1) hide show
  1. app/main.py +4 -4
app/main.py CHANGED
@@ -74,22 +74,22 @@ async def websocket_endpoint(websocket: WebSocket):
74
  # If it’s a text payload but with bytes (some FastAPI versions put audio under 'text'!)
75
  if kind == "websocket.receive" and "bytes" in data:
76
  raw_audio = data["bytes"]
77
- print(f"[INFO main] (text+bytes) Received audio chunk: {len(raw_audio)} bytes")
78
  result, rms = stream_audio(raw_audio, stream, recognizer, orig_sr)
79
  vol_to_send = min(rms * 20.0, 1.0)
80
- print(f"[INFO main] Sending → partial='{result[:30]}…', volume={vol_to_send:.4f}")
81
  await websocket.send_json({"partial": result, "volume": vol_to_send})
82
  continue
83
 
84
  elif kind == "websocket.receive_bytes":
85
  raw_audio = data["bytes"]
86
- print(f"[INFO main] Received audio chunk: {len(raw_audio)} bytes")
87
 
88
  # This will also print its own debug info (see asr_worker.py)
89
  result, rms = stream_audio(raw_audio, stream, recognizer, orig_sr)
90
 
91
  vol_to_send = min(rms * 20.0, 1.0)
92
- print(f"[INFO main] Sending → partial='{result[:30]}…', volume={vol_to_send:.4f}")
93
 
94
  await websocket.send_json({
95
  "partial": result,
 
74
  # If it’s a text payload but with bytes (some FastAPI versions put audio under 'text'!)
75
  if kind == "websocket.receive" and "bytes" in data:
76
  raw_audio = data["bytes"]
77
+ # print(f"[INFO main] (text+bytes) Received audio chunk: {len(raw_audio)} bytes")
78
  result, rms = stream_audio(raw_audio, stream, recognizer, orig_sr)
79
  vol_to_send = min(rms * 20.0, 1.0)
80
+ # print(f"[INFO main] Sending → partial='{result[:30]}…', volume={vol_to_send:.4f}")
81
  await websocket.send_json({"partial": result, "volume": vol_to_send})
82
  continue
83
 
84
  elif kind == "websocket.receive_bytes":
85
  raw_audio = data["bytes"]
86
+ # print(f"[INFO main] Received audio chunk: {len(raw_audio)} bytes")
87
 
88
  # This will also print its own debug info (see asr_worker.py)
89
  result, rms = stream_audio(raw_audio, stream, recognizer, orig_sr)
90
 
91
  vol_to_send = min(rms * 20.0, 1.0)
92
+ # print(f"[INFO main] Sending → partial='{result[:30]}…', volume={vol_to_send:.4f}")
93
 
94
  await websocket.send_json({
95
  "partial": result,