Skip to content

Flush audio buffer on prompt change for immediate TTS playback#719

Merged
leszko merged 1 commit intomainfrom
rafal/audio-flash
Mar 20, 2026
Merged

Flush audio buffer on prompt change for immediate TTS playback#719
leszko merged 1 commit intomainfrom
rafal/audio-flash

Conversation

@leszko
Copy link
Copy Markdown
Collaborator

@leszko leszko commented Mar 20, 2026

When prompts change, drain the audio output queue and send a flush sentinel so the audio track discards buffered speech from the previous prompt. Also increases the max audio buffer to 60s for TTS pipelines and reduces the audio output queue size to 10 (since it's now flushed on prompt changes).

For the context, I haven't yet decided if when we should flash audio. Maybe it's the UI that should decide (kind-of like cache reset), or maybe pipeline should return an information that the audio should be flushed. But for now, let's use the "workaround" to flush when there is a new prompt happening.

When prompts change, drain the audio output queue and send a flush
sentinel so the audio track discards buffered speech from the previous
prompt. Also increases the max audio buffer to 60s for TTS pipelines
and reduces the audio output queue size to 10 (since it's now flushed
on prompt changes).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Rafal Leszko <[email protected]>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 93fe35d1-7710-4d54-aab9-f5ae3ee277ad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rafal/audio-flash
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 fal.ai Preview Deployment

App ID daydream/scope-pr-719--preview
WebSocket wss://fal.run/daydream/scope-pr-719--preview/ws
Commit 00d9cdc

Testing

Connect to this preview deployment by running this on your branch:

uv run build && SCOPE_CLOUD_APP_ID="daydream/scope-pr-719--preview/ws" uv run daydream-scope

🧪 E2E tests will run automatically against this deployment.

@github-actions
Copy link
Copy Markdown
Contributor

✅ E2E Tests passed

Status passed
fal App daydream/scope-pr-719--preview
Run View logs

Test Artifacts

Check the workflow run for screenshots.

@leszko leszko marked this pull request as ready for review March 20, 2026 13:52
@leszko leszko merged commit 02e4502 into main Mar 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant