Skip to content

Commit

Permalink
Merge pull request #165 from pipecat-ai/clear-audio-output-buffer-whe…
Browse files Browse the repository at this point in the history
…n-interrupted

transport(base): clear audio output buffer if interrupted
  • Loading branch information
aconchillo authored May 22, 2024
2 parents 71ba287 + 3438488 commit 91c706a
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 91c706a

Please sign in to comment.