Expose configurable outgoing audio chunk duration for Deepgram Flux
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从 livekit-plugins-deepgram 包开始:找到 deepgram.STTv2 的构造函数,以及 SpeechStreamv2._run 循环中将 samples_per_channel 设置为 sample_rate // 20(50 ms 默认值)的位置。传入一个可选的正整数参数 chunk_size_ms,使得只有该批处理算术发生变化,同时保持默认值和部分分块的 flush 不变。添加一个 fake WebSocket 测试,断言 50 ms 和 80 ms 时发出的消息大小;完成的标准是默认行为不变且新选项产生 80 ms 的批次。注意该 issue 在询问维护者 API 是否合适,所以在投入大量精力之前请先确认是否被接受。
由索引模型根据 Issue 内容生成。
描述
Proposal
Expose an optional chunk_size_ms argument on deepgram.STTv2 so applications can configure outgoing PCM WebSocket batching. Keep the existing 50 ms default; allow opting into 80 ms without replacing the plugin's send loop.
In the tested Deepgram plugin version (1.6.1), SpeechStreamv2._run sets samples_per_channel to sample_rate // 20. Deepgram's Flux quickstart recommends 80 ms chunks (2,560 bytes for mono linear16 at 16 kHz).
Updated evidence: isolated Flux benchmark
We repeated the comparison with 24 direct WebSocket trials from a LiveKit Cloud worker in us-east, removing RTC media, VAD, LiveKit endpointing, LLM, and TTS from the measured path. This follow-up tests the effect of PCM batching on observed Flux EOT latency.
The primary metric is the interval from acoustic speech end on a real-time-paced PCM timeline to receipt of Flux EndOfTurn by the worker. Acoustic speech end is the end of the last 10 ms window with normalized RMS above 0.025. Both timestamps use the same worker-side monotonic clock.
| Synthetic utterance | Mean EOT latency, 50 ms chunks | Mean EOT latency, 80 ms chunks | Difference, 80 minus 50 |
|---|---|---|---|
| “Please tell me where to put the blue notebook.” | 437.5 ms | 400.7 ms | −36.8 ms |
| “Please put the blue notebook.” | 446.2 ms | 418.8 ms | −27.5 ms |
| “on the wooden table next to the lamp.” | 532.4 ms | 523.5 ms | −8.9 ms |
| All trials | 472.0 ms | 447.7 ms | −24.4 ms (about 5.2%) |
We used three distinct prerecorded utterances. Each utterance was sent to Flux eight times: four times using 50 ms audio chunks and four times using 80 ms audio chunks.
A trial means sending one complete utterance over a fresh WebSocket connection and measuring the time from its acoustic speech end to receipt of Flux’s EndOfTurn event. The 50 ms and 80 ms values describe the duration of audio in each WebSocket message—not the duration of the utterance or the interval between trials.
For a given utterance, every trial used identical PCM audio, including the same leading and trailing silence. Only the outgoing chunk size changed.
We organized the trials into two blocks:
| Block | First trial | Second trial | Third trial | Fourth trial |
|---|---|---|---|---|
| Block 1 | 50 ms | 80 ms | 80 ms | 50 ms |
| Block 2 | 80 ms | 50 ms | 50 ms | 80 ms |
We used this counterbalanced order to reduce the influence of changes over time, such as network conditions or provider load. Running all 50 ms trials first and all 80 ms trials afterward could favor whichever condition happened to run during a faster period. Reversing the order in the second block gives both chunk sizes exposure to earlier and later positions.
This reduces ordering bias
80 ms was faster in 8 of 12 adjacent matched pairs; the median paired difference was −23.5 ms. All 24 trials produced exactly one EndOfTurn, none before the acoustic boundary. Final transcripts matched across conditions for each utterance, and all EOT events had trigger: model.
Suggested scope
A constructor-only positive integer duration, documented in milliseconds, used solely by the local audio batching loop. Preserve the 50 ms default and existing partial-chunk flush behavior.
Would this API fit the plugin? A small draft implementation with fake-WebSocket tests can serve as a concrete proposal.
- 主要语言
- Python
- 星标
- 14.6k
- 派生
- 3.9k
- 平均合并
- 2 天 23 小时
- 30 天内合并 PR
- 177
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
livekit/agents 的其他 Issue
-
Assistant markup is stripped from chat history when expressive mode is off可能已有人在做 @ShivamSharma43 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hosts可能重新可做 @AbarnaaSree 于 45 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Tool argument errors put the argument values in the log message body, outside `lk.pii.*`可能已有人在做 @Li-john1021 今天认领。 未关闭
难度 3/5 半天 新手友好度 25/100
维护者通常 1 天内回复
-
Google Realtime (Vertex AI): update_instructions() appends a model turn instead of replacing the system instruction可能已有人在做 @Li-john1021 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 1 天内回复
-
elevenlabs: text-to-dialogue (v3/v4) alignment timestamps are chunk-relative, breaking synced transcripts可能已有人在做 @satheeshk50 今天认领。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
相似的 Issue
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk可能已有人在做 @rodricksz4h5 今天认领。 未关闭area/streaming comp/gateway P2 type/security
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#138245 ·
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS step可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
correction metadata
难度 2/5 1 小时以内 新手友好度 68/100
acl-org/acl-anthology#10378 · 1 条评论 ·
维护者通常 1 天内回复
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom name可能已有人在做 @12YYCCYY16 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
prowler-cloud/prowler#13033 ·
维护者通常 1 天内回复
-
enhancement
难度 1/5 1-3 小时 新手友好度 88/100
graygarbage/HermesKey#23 ·