Ensure resampling is skipped for empty audio frames#1044
Conversation
🦋 Changeset detectedLatest commit: 03114de The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| for (const frame of resampler.flush()) { | ||
| controller.enqueue(frame); | ||
| }, | ||
| flush(controller) { |
There was a problem hiding this comment.
This moves the flushing to the flush of the transform stream.
I don't know if the previous implemenation was intended to always flush after every insertion?
@toubatbrian do you happen to remember why this code path is flushing after each chunk?
There was a problem hiding this comment.
Here is the original PR: #541
What are the difference between flushing for each frames v.s. flushing at the very end? I guess technically they are the same but maybe flushing on every frame would incur some more performance costs?
Description
While testing I ran into a panic on the underlying rust sdk originating from a null pointer.
Tracing it back it looks like it was triggered by a
0value that was passed back after trying to resample an empty audio frame.Changes Made
Pre-Review Checklist
Testing
restaurant_agent.tsandrealtime_agent.tswork properly (for major changes)Additional Notes
Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.