Skip to content

perf: reduce inter-turn delays for faster voice chat response#15

Merged
Gabry848 merged 1 commit intomasterfrom
fix/reduce-turn-delay
Feb 10, 2026
Merged

perf: reduce inter-turn delays for faster voice chat response#15
Gabry848 merged 1 commit intomasterfrom
fix/reduce-turn-delay

Conversation

@Gabry848
Copy link
Copy Markdown
Collaborator

Problema

Tra un turno e l'altro della conversazione vocale, vari setTimeout introducevano ritardi non necessari di 300-500ms prima di riavviare il microfono.

Modifiche

In useVoiceChat.ts:

  • Delay iniziale di avvio registrazione: 500ms → 150ms
  • Tutti i delay di auto-restart dopo agent_end, audio_end, interrupted: 300ms/200ms → 100ms

Impatto

~200-400ms in meno tra i turni di conversazione vocale. L'utente percepisce una conversazione più fluida e naturale.

Rischi

Minimi: il delay di 100ms è sufficiente per garantire che lo state update di React sia completato prima del restart del microfono.

- Reduce initial recording start delay from 500ms to 150ms
- Reduce all auto-restart recording delays from 300ms/200ms to 100ms
- Applies to: agent_end, audio_end, interrupted, and audio_end+no_chunks states

Total improvement: ~200-400ms less delay between conversation turns.
@Gabry848 Gabry848 merged commit d8e9b37 into master Feb 10, 2026
1 check failed
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