Skip to content

Use a PyAV resampler per participant for input audio - #21

Open
dangusev wants to merge 1 commit into
mainfrom
fix/use-pyav-resampler
Open

dangusev wants to merge 1 commit into
mainfrom
fix/use-pyav-resampler

Conversation

@dangusev

Copy link
Copy Markdown
Collaborator
  • pipecat's soxr VHQ stream resampler held 10-76 ms of audio, which is too long.

  • Replaced it with av.AudioResampler. It holds 1 ms of audio and gives output for every packet.

  • UserAudioRawFrame.pts is the pts of the first sample in the frame.

  • Each participant now gets a separate resampler, so audio and pts of different participants do not mix.

  • The resampler of a participant is removed when their audio track is unsubscribed, because a new track restarts its pts.

- pipecat's soxr VHQ stream resampler held 10-76 ms of audio, which is too long.

- Replaced it with av.AudioResampler. It holds 1 ms of audio and gives output for every packet.
- UserAudioRawFrame.pts is the pts of the first sample in the frame.
- Each participant now gets a separate resampler, so audio and pts of different participants do not mix.
- The resampler of a participant is removed when their audio track is unsubscribed, because a new track restarts its pts.
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