Naturalize floating bar voice streaming#6259
Conversation
Greptile SummaryThis PR improves voice playback quality in the floating control bar by switching the default ElevenLabs voice from Rachel to Sloane, retuning voice settings for more natural delivery, and significantly reworking the text-chunking heuristic to wait for sentence-level boundaries before handing text off to the TTS API — reducing the "stitched robot prosody" caused by over-eager chunking. Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[New streamed text arrives] --> B{text.count >= minimumChunkLength\n85 chars?}
B -- No --> WAIT[Return nil — buffer more text]
B -- Yes --> C[Search preferredSlice\n0..220 chars for '.!?\\n']
C -- Found --> SPLIT1[Split after last sentence-ending punctuation]
C -- Not found --> D{text.count >= preferredChunkLength\n220 chars?}
D -- No --> WAIT
D -- Yes --> E[Search emergencySlice\n0..360 chars for '.!?\\n']
E -- Found --> SPLIT2[Split after punctuation in emergency window]
E -- Not found --> F{text.count >= emergencyChunkLength\n360 chars?}
F -- No --> WAIT
F -- Yes --> G[Search emergencySlice for ',;:']
G -- Found --> SPLIT3[Split after clause separator]
G -- Not found --> H[Search emergencySlice for whitespace]
H -- Found --> SPLIT4[Split at last whitespace]
H -- Not found --> SPLIT5[Hard cut at emergencyLimit]
Reviews (1): Last reviewed commit: "Naturalize floating bar voice streaming" | Re-trigger Greptile |
|
|
||
| guard text.count >= emergencyChunkLength else { return nil } | ||
|
|
||
| if let clauseIndex = emergencySlice.lastIndex(where: { ",;:\n".contains($0) }) { |
There was a problem hiding this comment.
Redundant
\n in clause separator set
At this point in the control flow, the preceding emergencySlice.lastIndex(where: { ".!?\n".contains($0) }) check on the same slice has already returned nil, which guarantees there is no \n character anywhere within emergencySlice. Including \n in ",;:\n" is therefore unreachable dead code on this path.
| if let clauseIndex = emergencySlice.lastIndex(where: { ",;:\n".contains($0) }) { | |
| if let clauseIndex = emergencySlice.lastIndex(where: { ",;:".contains($0) }) { |
## Summary - switch the default ElevenLabs voice from Rachel to Sloane for a less generic release voice - make streaming wait for sentence-sized chunks before speaking, with a larger emergency cutoff to avoid stitched robot prosody - slightly retune ElevenLabs voice settings and align the settings copy with the shipped default voice ## Verification - intended verification target was the Mac mini only - the Mac mini became unreachable over SSH during this pass, so I could not complete the remote compile/run loop before merging - root cause for the reported bad voice was verified from source and release tags: v0.11.214 already contains streaming playback, still defaults to generic voices without a custom voice id, and chunks aggressively enough to sound robotic
Summary
Verification