Skip to content

Add StreamingTranscriptionClient for streaming from any source - #480

Merged
makaveli10 merged 3 commits into
collabora:mainfrom
Kokkini:feature/streaming-transcription-client
Jul 17, 2026
Merged

Add StreamingTranscriptionClient for streaming from any source#480
makaveli10 merged 3 commits into
collabora:mainfrom
Kokkini:feature/streaming-transcription-client

Conversation

@Kokkini

@Kokkini Kokkini commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Thanks for this awesome repo. I'm using it in one of my production web apps. I did this PR because I had the following issues:

  • My use case: FE (web app) records audio and sends to my server instead of WhisperLive (for auth, pre-processing, storage), then my server sends to my self-hosted WhisperLive. Currently WhisperLive does not provide an official way to transcribe an audio stream from a backend server.
  • The completed flag on segments wasn't documented, making it hard to distinguish in-progress (partial) from finalized (committed) transcripts without digging into the source. I was confused for some time.

I solved those for my use case by implementing my own client class. I thought others would benefit from the ability to transcribe an audio stream from anywhere (for example, a frontend, a backend, a processed stream — not just a file or live mic). Thus, I made this PR.

  • Add StreamingTranscriptionClient that supports streaming from any audio source with the simple interface of client.send(chunk) and callbacks to receive results.
  • The new client splits the single transcription callback into on_partial_transcript and on_committed_transcript to make the partial/committed distinction explicit and easy to use.
  • Add examples/manual_audio_chunking.py to show how to use the new client, and document it in the README.
  • _HookedClient is an internal subclass used by StreamingTranscriptionClient and is not part of the public API.

I intentionally made no changes to the server or the existing client classes so this is as non-disruptive as possible.

Let me know if this helps or anything needs to be changed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new StreamingTranscriptionClient to let callers stream raw PCM audio chunks from arbitrary sources (backend streams, pipelines, etc.) into WhisperLive, and receive partial vs committed transcripts via dedicated callbacks. It also adds documentation and an example script to demonstrate manual chunking.

Changes:

  • Added StreamingTranscriptionClient (and internal _HookedClient) to support manual PCM chunk streaming with callbacks for partial/committed transcripts.
  • Documented the new streaming client usage and callbacks in README.md.
  • Added examples/manual_audio_chunking.py demonstrating file-to-chunk streaming into the server.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
whisper_live/client.py Adds _HookedClient and StreamingTranscriptionClient for manual audio chunk streaming + callback dispatch.
README.md Documents the new streaming client API and provides usage examples.
examples/manual_audio_chunking.py Demonstrates chunked audio streaming and printing partial/committed output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread whisper_live/client.py
Comment thread whisper_live/client.py Outdated
Comment thread whisper_live/client.py
Comment thread whisper_live/client.py Outdated
Comment thread whisper_live/client.py Outdated
Comment thread whisper_live/client.py Outdated
Comment thread README.md Outdated
Comment thread examples/manual_audio_chunking.py Outdated
Comment thread whisper_live/client.py
@makaveli10

makaveli10 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@Kokkini can you please address the comments from copilot review and resolve the merge conflicts as well?

@Kokkini

Kokkini commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Ok, I'll do that later today

@Kokkini
Kokkini force-pushed the feature/streaming-transcription-client branch from 296b69b to ec1dc7c Compare July 8, 2026 16:16
@Kokkini

Kokkini commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@makaveli10 I addressed the comments and rebased to resolve the merge conflicts.

@makaveli10
makaveli10 merged commit 06ec024 into collabora:main Jul 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants