From b7f12a96f1acad1b64e9197d9d31cef6c96b88d3 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Mon, 11 Aug 2025 09:11:17 -0300 Subject: [PATCH] Improving the latency of the HeyGenVideoService. --- CHANGELOG.md | 2 ++ src/pipecat/services/heygen/client.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c4ec65df..5c8603121 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Other +- Improving the latency of the `HeyGenVideoService`. + - Updated `15-switch-voices.py` and `15a-switch-languages.py` examples to show how to enclose complex logic (e.g. `ParallelPipeline`) into a single processor so the main pipeline becomes simpler. diff --git a/src/pipecat/services/heygen/client.py b/src/pipecat/services/heygen/client.py index 9bd66d6a8..e2c6cf57f 100644 --- a/src/pipecat/services/heygen/client.py +++ b/src/pipecat/services/heygen/client.py @@ -362,7 +362,7 @@ class HeyGenClient: """Simulate audio playback timing with appropriate delays.""" # Only sleep after we've sent the first second of audio # This appears to reduce the latency to receive the answer from HeyGen - if self._audio_seconds_sent < 1.0: + if self._audio_seconds_sent < 3.0: self._audio_seconds_sent += self._send_interval self._next_send_time = time.monotonic() + self._send_interval return