Skip to content

Commit

Permalink
transport(base): clear audio output buffer if interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed May 22, 2024
1 parent 71ba287 commit 3438488
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Clear the audio output buffer if we are interrupted.

- Re-add exponential smoothing after volume calculation. This makes sure the
volume value being used doesn't fluctuate so much.

Expand Down
25 changes: 0 additions & 25 deletions src/pipecat/processors/utils/audio.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/pipecat/transports/base_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ def _sink_thread_handler(self):
self._internal_push_frame(frame), self.get_event_loop())
future.result()
else:
# Send any remaining audio
self._send_audio_truncated(buffer, bytes_size_10ms)
# If we get interrupted just clear the output buffer.
buffer = bytearray()

if isinstance(frame, EndFrame):
Expand Down

0 comments on commit 3438488

Please sign in to comment.