pltobing commited on
Commit
6dbcce8
·
1 Parent(s): b14cc99

Change default client sample rate to 16k

Browse files
clients/python_client.py CHANGED
@@ -18,7 +18,7 @@ Example streaming speech translation client (Python CLI).
18
  Usage
19
  -----
20
 
21
- python clients/python_client.py --uri ws://localhost:8765 --sample-rate 48000
22
  """
23
 
24
  from __future__ import annotations
@@ -50,7 +50,7 @@ async def main(uri: str, sample_rate: int, chunk_duration_ms: int) -> None:
50
  uri :
51
  WebSocket server URI, e.g. ``"ws://localhost:8765"``.
52
  sample_rate :
53
- Microphone capture sample rate (Hz), e.g. 48000.
54
  chunk_duration_ms :
55
  Audio chunk duration in milliseconds, e.g. 10.
56
  """
@@ -177,8 +177,8 @@ if __name__ == "__main__":
177
  parser.add_argument(
178
  "--sample-rate",
179
  type=int,
180
- default=48000,
181
- help="Microphone sample rate in Hz (default: 48000)",
182
  )
183
  parser.add_argument(
184
  "--chunk-ms",
 
18
  Usage
19
  -----
20
 
21
+ python clients/python_client.py --uri ws://localhost:8765 --sample-rate 16000
22
  """
23
 
24
  from __future__ import annotations
 
50
  uri :
51
  WebSocket server URI, e.g. ``"ws://localhost:8765"``.
52
  sample_rate :
53
+ Microphone capture sample rate (Hz), e.g. 16000.
54
  chunk_duration_ms :
55
  Audio chunk duration in milliseconds, e.g. 10.
56
  """
 
177
  parser.add_argument(
178
  "--sample-rate",
179
  type=int,
180
+ default=16000,
181
+ help="Microphone sample rate in Hz (default: 16000)",
182
  )
183
  parser.add_argument(
184
  "--chunk-ms",
clients/web_client.html CHANGED
@@ -252,8 +252,8 @@ http://creativecommons.org/licenses/by-nc-nd/4.0/
252
  let transcriptText = "";
253
 
254
  // Client capture parameters: 10 ms chunks at 48 kHz.
255
- const SAMPLERATE = 48000;
256
- const CHUNK_SIZE = 480; // 10 ms at 48k
257
 
258
  function setStatus(text, state) {
259
  document.getElementById("statusText").textContent = text;
 
252
  let transcriptText = "";
253
 
254
  // Client capture parameters: 10 ms chunks at 48 kHz.
255
+ const SAMPLERATE = 16000;
256
+ const CHUNK_SIZE = 160; // 10 ms at 48k
257
 
258
  function setStatus(text, state) {
259
  document.getElementById("statusText").textContent = text;