fix(audio): migrate Android JNI paths

This commit is contained in:
Edison Jwa
2026-06-08 21:24:16 +09:00
parent 901369b072
commit 5a1d902795
3 changed files with 259 additions and 221 deletions
@@ -49,6 +49,7 @@ pub(crate) struct AndroidRenderRingConsumer {
}
impl AndroidRenderRingConsumer {
#[cfg(test)]
pub(crate) fn drain_into_zero_filling(&self, out: &mut [f32]) {
let mut chunks = out.chunks_exact_mut(2);
for frame_out in &mut chunks {
@@ -59,6 +60,13 @@ impl AndroidRenderRingConsumer {
*sample = 0.0;
}
}
pub(crate) fn drain_stereo_into_zero_filling(&self, out: &mut [(f32, f32)]) {
for frame_out in out {
let frame = self.frames.pop().unwrap_or([0.0, 0.0]);
*frame_out = (frame[0], frame[1]);
}
}
}
#[cfg(test)]