diff --git a/crates/ec-probe/src/decoder.rs b/crates/ec-probe/src/decoder.rs index 62d9bbb1..c1ee8ff2 100644 --- a/crates/ec-probe/src/decoder.rs +++ b/crates/ec-probe/src/decoder.rs @@ -373,7 +373,9 @@ fn is_pcm(codec: CodecId) -> bool { | CodecId::PcmS16Le | CodecId::PcmS16Be | CodecId::PcmS24Le + | CodecId::PcmS24Be | CodecId::PcmS32Le + | CodecId::PcmS32Be | CodecId::PcmF32Le ) } @@ -462,10 +464,18 @@ fn pcm(codec: CodecId, data: &[u8], out: &mut Vec) { let v = i32::from_le_bytes([0, c[0], c[1], c[2]]); v as f32 / 2147483648.0 })), + CodecId::PcmS24Be => out.extend(data.as_chunks::<3>().0.iter().map(|c| { + let v = i32::from_be_bytes([c[0], c[1], c[2], 0]); + v as f32 / 2147483648.0 + })), CodecId::PcmS32Le => out.extend( data.as_chunks::<4>().0.iter() .map(|c| i32::from_le_bytes([c[0], c[1], c[2], c[3]]) as f32 / 2147483648.0), ), + CodecId::PcmS32Be => out.extend( + data.as_chunks::<4>().0.iter() + .map(|c| i32::from_be_bytes([c[0], c[1], c[2], c[3]]) as f32 / 2147483648.0), + ), CodecId::PcmF32Le => out.extend( data.as_chunks::<4>().0.iter() .map(|c| f32::from_le_bytes([c[0], c[1], c[2], c[3]])),