72 Commits

Author SHA1 Message Date
Aaron Boxer c5ec7f4a99 Add reconnect logic to WebSocket client
- New params: max_retries (default 0), retry_delay (default 5s)
- On unexpected close, retries up to max_retries times
- Does not retry on server_error (server rejected connection)
- Extracted _create_websocket() helper for reuse
- Added 4 unit tests for reconnect behavior
2026-05-26 05:45:37 -04:00
Aaron Boxer 4e31f8c61b Add word-level timestamps and confidence scores
- New word_timestamps option (default False) in client handshake
- When enabled, each segment includes 'words' array with per-word
  start/end times and probability scores
- Wired through entire pipeline: client → server → backend → transcribe()
- Words include timestamp_offset for accurate absolute times
- REST API already supported word timestamps; now WebSocket does too
- Added 9 unit tests for word timestamp extraction and formatting
2026-05-15 10:35:27 -04:00
Aaron Boxer 18b897277f Add real-time speaker diarization support
- New whisper_live/diarization.py: SpeakerDiarizer with online clustering
- Uses pyannote.audio speaker embeddings (optional dependency)
- Cosine similarity threshold for speaker matching (default 0.55)
- Running average embedding update for speaker stability
- Configurable max_speakers limit (default 10)
- Client options: enable_diarization, max_speakers
- Segments include 'speaker' field when diarization is active
- Graceful fallback: logs warning if pyannote not installed
- Added 12 unit tests (mock-based, no GPU required)
2026-05-13 10:50:59 -04:00
Aaron Boxer 4210697ca6 Add custom vocabulary / hotwords support 2026-05-13 10:32:28 -04:00
nightcityblade 067573a510 feat: make display_segments configurable in Client/TranscriptionClient
Replace hardcoded [-4:] truncation with a configurable display_segments
parameter (default: 4) in both Client and TranscriptionClient classes.

Fixes #377
2026-03-08 12:19:54 +08:00
Jeny Sadadia 5e33aa2a7e Enable timestamps for transcripted text
Add `--enable-timestamps` option to `run_client.py`
script to print out transcripted text with timestamps.

Sample output with translation enabled:
```
[0.000 -> 7.440]  And so, my fellow Americans, ask not what your country can do for you.
[7.440 -> 10.300]  Ask what you can do for your country.

TRANSLATION to fr:
[0.000 -> 7.440] Et donc, mes camarades américains, ne demandez pas ce que votre pays peut faire pour vous.
[7.440 -> 10.300] Demandez ce que vous pouvez faire pour votre pays.
```

Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
2026-02-10 15:43:20 +05:30
makaveli10 2b8b245fa8 Add translation backend
Translate from any language to any language with alirezamsh/small100
running in a thread and reading from a queue shared with transcription thread.

Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2025-07-22 08:54:10 +00:00
makaveli10 8d6ddd4f7b Change max_clients max_connection_time from server only
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2025-07-21 22:52:24 +05:30
Kiran Lonikar e597c876cf changes to run when audio playback is muted 2025-07-07 13:21:20 +05:30
Erik b91b3664c2 Add transcription callback parameter to TranscriptionClient #361 2025-05-14 23:03:14 +02:00
makaveli 4ba576fb06 Merge pull request #374 from xXLosKrachosXx/main
Add transcription callback to Client for handling transcription results
2025-05-14 20:19:25 +05:30
Erik 188b21f1d0 Add transcription callback to Client for handling transcription results 2025-05-12 20:56:04 +02:00
rover0811 d29993048d Fix: Enable support for WebSocket streaming in client.
Added the `use_wss` parameter to allow the client to handle WebSocket-based streaming. This enhances flexibility for real-time transcription scenarios.
2025-05-12 16:42:11 +09:00
rover0811 41d9f683a8 Add: support for secure WebSocket (WSS) connections
Introduce an optional `use_wss` flag to enable secure WebSocket protocol. Updated socket URL generation to dynamically select between `ws` or `wss` based on the flag value. Ensures greater flexibility when connecting to secure servers.
2025-05-12 13:53:41 +09:00
giubots 275ed4e45b Merge branch 'main' into configure-more-params 2025-05-02 12:23:45 +02:00
giubots a2271806c3 feat: client sends new parameters to server 2025-04-28 17:21:33 +02:00
Emmanuel Ferdman 444a1df740 Resolve daemon warnings for threading methods
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-04-25 00:30:08 -07:00
makaveli10 87520498e9 Add option to mute audio playback for file input
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2025-02-05 20:23:41 +05:30
makaveli10 5aa5826f36 Replace ffmpeg with av lib for resampling, rtsp & hls streams
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2025-01-22 05:11:04 -05:00
makaveli10 49e232bc4d Set segment.completed to False by default
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2024-12-03 20:09:41 +05:30
makaveli10 a1650eaa4f Fix client tests to write srt file
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2024-11-19 13:31:55 +05:30
makaveli10 81c57ae40c Send completed bool with each segment
Completed bool represents if the segment is completely processed by the server

Signed-off-by: makaveli10 <suryanvineet47@gmail.com>
2024-11-05 18:11:32 +05:30
makaveli10 0d74790c67 Expose ClientManager arguments to be passed from client
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2024-10-10 08:37:45 -04:00
makaveli10 4870e9fb9e Make text logging optional
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2024-08-08 06:09:44 -04:00
Sean Dang abfe830eee Fix deadlock issue in FFmpeg subprocess by ensuring stderr is consumed 2024-07-11 23:30:44 +07:00
chien-liu cfba5b3e54 Expose the srt file location of Transcription client 2024-06-01 00:14:59 +02:00
makaveli10 9d2ea75247 Refactor to make record function more readable
Signed-off-by: makaveli10 <suryanvineet47@gmail.com>
2024-05-28 11:06:49 +05:30
makaveli10 61d07edabb Make writing output audio file optional when using microphone
Signed-off-by: makaveli10 <suryanvineet47@gmail.com>
2024-05-28 11:06:49 +05:30
dshepelev15 615c9c7aed Add support for RTSP stream 2024-05-17 17:32:09 +03:00
fraic f78fc473c5 Add option: save network stream to local file while transcribing 2024-03-25 19:11:24 +08:00
makaveli10 66b5dc7c15 Merge remote-tracking branch 'upstream/main' into fix_client_close 2024-03-22 12:13:44 +05:30
makaveli10 0f1d36fc06 fix: microphone client close 2024-03-22 12:13:27 +05:30
John Sichi fe1640695c Don't clear server_error flag on close. 2024-03-21 13:28:18 +09:00
John Sichi 37d7f2ed66 Merge branch 'main' into tee-client 2024-03-13 20:12:51 +09:00
John Sichi 5b32dc4130 Fix default value for multicast. 2024-03-10 21:02:50 +09:00
John Sichi 3b15dc76b4 Add support for processing same audio stream via multiple clients with different tasks. 2024-03-10 20:44:15 +09:00
FlippFuzz 4d477e35e7 Handle failure on systems without microphones
Catch the OSError and print a WARN log.
2024-03-10 19:43:53 +08:00
makaveli10 dc22b7da9f add srt_file_path option 2024-02-20 11:53:45 +05:30
makaveli10 b42ced9816 fix: tests for end of speech message while mocking pyaudio 2024-02-16 20:31:38 +05:30
makaveli10 78da3f6750 Merge branch 'code_formatting' into vad_option 2024-02-16 17:29:37 +05:30
makaveli10 147e97002e clear_screen for updated transcript 2024-02-15 18:56:14 +05:30
makaveli10 9bb92b9bb2 use_vad option and send end of audio message 2024-02-15 17:59:12 +05:30
makaveli10 3cd96367fb make vad an option 2024-02-15 14:59:43 +05:30
makaveli10 ceb3cc8747 update timeout log 2024-02-09 14:20:47 +05:30
makaveli10 9fbff47126 🔨 refactor whisper_live according to flake8 2024-02-09 13:45:13 +05:30
makaveli10 bc474b4a76 update on_close; on_error 2024-02-08 14:06:06 +05:30
makaveli 6071cc1cc5 Revert "Test pypi upload" 2024-02-08 12:23:15 +05:30
makaveli10 d6edf8e847 update on_error; on_close 2024-02-07 23:29:22 +05:30
makaveli10 56d19f5469 fix: typo; remove multilingual debug stat 2024-02-04 14:34:16 +05:30
Sasa Trivic e697574870 Remove multilingual from client. Remove multilingual from faster whisper backend. Disable task dropdown when capturing in chrome extension. 2024-02-02 13:56:26 +01:00