rust-sdks icon indicating copy to clipboard operation
rust-sdks copied to clipboard

AudioResampler: initialize frame_.samples_per_channel_

Open Be-ing opened this issue 1 month ago • 2 comments

This change is needed for the same reason as b776e64a3e1a33b92ffe94ffba389a318ae87f41 (#722):

A change in the resampler API introduced in libwebrtc m137 caused the output frame's samples_per_channel_ property to remain uninitialized. As a result, the length of the output slice was always calculated as zero, resulting in NativeAudioStream yielding audio frames without any sample data.

Be-ing avatar Nov 04 '25 18:11 Be-ing

I'm unclear why #722 made a change at a higher level of the stack in NativeAudioSink rather than fixing it here. Zed calls AudioResampler::remix_and_resample directly, so switching to this repository's main branch broke audio playback in Zed.

Be-ing avatar Nov 04 '25 18:11 Be-ing

@xianshijing-lk could you take a look at this? Zed panics on livekit's main branch without this one line change.

Be-ing avatar Nov 17 '25 19:11 Be-ing

Ping @xianshijing-lk, could you take a look at this one line fix?

Be-ing avatar Dec 04 '25 19:12 Be-ing

I just landed it. Sorry for missing the email notification.

xianshijing-lk avatar Dec 04 '25 19:12 xianshijing-lk