Text-to-Speech
ONNX
GGUF
speech-translation
streaming-speech-translation
speech
audio
speech-recognition
automatic-speech-recognition
streaming-asr
ASR
NeMo
ONNX
cache-aware ASR
FastConformer
RNNT
Parakeet
neural-machine-translation
NMT
gemma3
llama-cpp
GGUF
conversational
TTS
xtts
xttsv2
voice-clone
gpt2
hifigan
multilingual
vq
perceiver-encoder
websocket
Change default client sample rate to 16k
Browse files- clients/python_client.py +4 -4
- clients/web_client.html +2 -2
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
|
| 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.
|
| 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=
|
| 181 |
-
help="Microphone sample rate in Hz (default:
|
| 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 =
|
| 256 |
-
const CHUNK_SIZE =
|
| 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;
|