Why do live captions change? Three states in streaming ASR
During a meeting, a caption first says “See you on Thursday.” After the speaker pauses, it changes to “See you on Friday.” This need not be a display bug: some systems offer an early hypothesis, then recognize a complete speech segment again. But an application that appends both versions repeats the sentence. An application that treats the first completed segment as the end of the meeting can lose everything that follows.
This article answers one question: when a recognition message arrives, should you append text, replace a draft, or finish the task? You will be able to separate a current draft, completed segments and completion of the entire input. This is a conceptual guide, not a server deployment recipe. No installation is required. The conversation and message sequence below are invented illustrations, not measured model outputs.
On this page: Choose a route · How streaming works · Read the messages · Understand latency · Acceptance scenarios · Agent integration contract
Do you need words while someone speaks, or a transcript afterwards?
FunASR is a toolkit for model execution and processing pipelines. Fun-ASR and SenseVoice are model families; capabilities depend on the specific model, weights and execution path. FunClip is a transcription and clipping application. This article concerns streaming Paraformer and the official repository's Python WebSocket example. An offline model does not become a streaming model by changing its name, and an editing application is not automatically a live-caption service.
For a recording that already exists, start with your first audio transcription. You may not need network sessions, provisional text and revisions at all. Streaming matters when people must see words before the speaker finishes. Two-pass recognition supplies an early result, then recognizes a completed segment again. It suits a display that permits revisions. It is not a reason to execute an irreversible payment, email or device command from every provisional word.
An installation package supplies software; model weights supply learned parameters; a runtime executes the model; a service also manages connections, access and resources. Installing funasr does not mean every required model is available or that a service has been deployed. The protocol details below apply only to the referenced Python example. Check C++ servers, HTTP APIs and other models separately. See the model and runtime selection guide for those decisions.
Streaming is not independent recognition of arbitrary small slices
Offline recognition can begin with a complete input. Streaming recognition processes arriving audio in chunks, using state from earlier chunks to help interpret later ones. This state is commonly called a cache. Here that means inference state for the current audio stream, not downloaded model files on disk.
The inspected streaming Paraformer Python path reuses a cache across consecutive chunks and requests final processing with is_final=True. Replacing the cache with an empty dictionary on every call repeatedly removes that context. Sharing one cache between unrelated recordings risks mixing contexts. A chunk that emits no text is not automatically a failure: the available audio may not yet support an output. A short final remainder still needs the interface's finalization step; do not discard it.
Voice activity detection, or VAD, is another layer. It estimates where speech is present and where a speech segment may end. It is not a grammar parser: a pause does not necessarily end a sentence, and a name or number can span a pause. The second pass has more segment context and may revise words or punctuation. It can still be wrong. “Second pass” describes a process, not an accuracy guarantee.
Separate drafts, completed segments and completed input
Two text contracts can look similar on screen. With incremental output, messages might contain “See you” and then “on Thursday”; the display joins the new pieces. With a cumulative hypothesis, messages might contain “See you” and then “See you on Thursday”. Appending those produces “See youSee you on Thursday”. The word “streaming” alone does not identify the contract.
The referenced Python example client treats online / 2pass-online text as increments and handles 2pass-offline as a segment result. The following invented sequence illustrates the design. It is not a complete set of wire messages or an audio test fixture.
| What arrives | What it means | What the caption application does |
|---|---|---|
2pass-online“See you”, then “on Thursday” | Incremental draft for the current segment | Show “See you on Thursday” in the draft area without treating it as verified content. |
2pass-offline“See you on Friday.”; is_final=true | Second-pass result for this segment | Replace the corresponding draft with “See you on Friday.” and retain it as a completed segment. Do not concatenate both versions. |
2pass-online“At three” | The input is continuing | Keep the previous segment and start a new draft. The first final segment did not end the entire input. |
mode=2passis_end=true and is_final=true | Acknowledgement after the sender ends input and the server finishes pending work | This is a control message and can have no text field. Only now is protocol processing for this input complete. |
Before that last row, the file-input client sends is_speaking=false and is_end=true. The server finishes pending online and offline work, then acknowledges it. If finalization recorded errors, the acknowledgement has is_final=false and an error. Receiving a segment result, sending the last audio frame and observing a closed connection are all different from receiving a successful end acknowledgement.
A successful acknowledgement does not guarantee nonempty text, correct words, correct punctuation or success of every auxiliary feature. Some auxiliary processing errors have separate handling in the referenced implementation. Check protocol completion, required fields and content quality separately instead of letting one boolean stand for all three.
The example client's display logic is not a general concurrent revision protocol. Do not assume responses contain usable segment IDs or replay-deduplication IDs. Confirm ordering and segment association before integrating. Keep connection identifiers, segment numbers and revision history maintained by your application distinct from original server fields. If a correction cannot be associated with a segment, stop automatic assembly and retain the message; do not silently overwrite history using text similarity.
A 600 ms audio chunk is not a 600 ms caption-latency promise
The official streaming example uses chunk_size=[0,10,5]. Its example center-chunk input stride is 10 × 960 = 9600 samples. At 16000 Hz, those samples represent 9600 / 16000 = 0.6 seconds of sound. That arithmetic measures audio duration, not inference execution time or measured time from speech onset to visible text.
The viewer's wait also includes audio accumulation, required model context, upload and queueing, computation, response delivery and display refresh. A second-pass result may additionally wait for VAD endpointing and offline recognition. Observe at least three things separately: time to first visible text, how long revisions continue, and time from speech end to the completed segment. Throughput measured by feeding an in-memory recording as fast as possible is not microphone-response latency.
Smaller chunks do not guarantee a shorter wait everywhere. Fixed overhead, scheduling and concurrent load matter, and parameters must remain valid for the selected model. Whether a CPU meets a target depends on the model, audio, machine, threads and workload. A GPU does not guarantee end-to-end real-time behavior either. This article measures or promises neither device's live performance.
Check four scenarios before trusting a live-caption integration
- Two segments with a revision. Retain original messages. Check that second-pass text replaces the current draft without duplicating it or erasing an earlier completed segment.
- A short ending with little silence. Check that the last partial chunk is sent and that final words are not lost before acknowledgement. Do not trim the recording to make the workflow appear successful.
- Silence or no recognizable content. Permit empty results. Distinguish successful protocol completion with no text from timeout or inference failure; never invent captions to fill a gap.
- Connection loss, timeout and server error. Mark the task as failed or incomplete while retaining received segments. Text already visible in a draft area is not evidence that the entire recording succeeded.
Run these scenarios in your environment with audio you are entitled to process; this article has not run them for you. Listen back to names, numbers and negations as part of caption acceptance. A voice assistant may use provisional text for reversible interface feedback, but sending, spending or deleting requires the application's confirmation rules. An ASR “final” flag is not user authorization.
For agents: retain events before deriving captions
Record the exact source revision, model identifiers and configuration for the referenced Python WebSocket path. These fields are not an ecosystem-wide FunASR contract. Recheck them for another service.
modeis a string. Requests chooseonline,offlineor2pass; two-pass results can use2pass-online/2pass-offline. Dispatch by message type, not merely by the presence oftext.textis a recognition string that may be empty; end acknowledgements can omit it.is_finalandis_endare booleans with distinct segment and end-acknowledgement roles.wav_nameis an input-name string, not a verified identity, filesystem path or unique deduplication key.- Store application-side connection identity, receive order, original messages and derived caption revisions separately. Use the confirmed ordered, single-connection contract; never mix caches or drafts from different recordings. Do not present your own bookkeeping fields as server-provided data.
- After file input ends, wait within a bound for the matching acknowledgement. The example CLI's
--result_timeoutis in seconds and defaults to 300. That is a wait limit, not a performance guarantee. Timeouts, negative acknowledgements and early disconnects must report incompleteness. Do not automatically retry protocol errors. Retry transient transport failures only within an authorized limit, recording each attempt separately to avoid duplicate captions. - Reading requires neither model downloads nor audio uploads. Actual integration separately requires dependency and environment checks, model weights and license review, and permission for initial downloads. Offline operation requires all needed files and verification that execution will not fetch missing ones. Microphone capture, audio uploads, paid services and storage of other people's recordings need the corresponding authorization.
For repeated words, first check incremental versus cumulative output. For repeated sentences, check whether offline corrections were appended again. For missing endings, check the tail chunk and acknowledgement. For excessive latency, separate queueing, inference and endpoint waiting. Identify the failing layer before deciding whether the model or the integration needs to change.
Sources and next steps
This explanation reviews message construction, client assembly, end acknowledgement and sample arithmetic in the pinned official sources below. Conversation and table entries are illustrative. No model inference or live-latency benchmark was run for this revision. These references identify source code, not a promise that every installed wheel includes matching server scripts.
- Python WebSocket server: segment messages and finish_input
- Python client: incremental display, two-pass results and acknowledgement waiting
- Streaming Paraformer: state, input stride and finalization
- Configuration and client documentation for this Python example
Before chasing smaller chunks, define what you will deliver: how soon people need a draft, what revisions are acceptable, and which message completes the task. Those three answers make live captions more than words that appear quickly on a screen.