You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make 2.5 ms Opus frame durations work across bindings #3208
Native Rust supports every Opus frame duration, including 2.5 ms, and tests it. Public binding surfaces advertise the same support but cannot represent or carry it correctly:
UniFFI exposes frame_duration_ms: u32 and converts with integer milliseconds, so 2.5 is unrepresentable: audio.rs
C has the same integer representation and conversion.
JavaScript accepts a floating-point millisecond value, then routes it through an integer catalog field and rejects 2.5.
The native encoder validates exact durations of 2.5, 5, 10, 20, 40, and 60 ms.
Rounding to 2 or 3 ms is not valid because the Opus backend rejects both.
This overlaps #3189 only at the 20 ms default. The representational bug is cross-surface and should be fixed independently.
Settled API
Keep the concise frame_duration_ms spelling:
UniFFI: f64, default 20.0
C: double, with zero selecting the 20 ms default
JavaScript: retain floating-point Time.Milli
Validate that the value is exactly one of 2.5, 5, 10, 20, 40, 60.
Implementation plan
Change the FFI and C scalar types to floating-point milliseconds and perform exact supported-value validation before converting to Duration.
Activity
kixelated commentedon Oct 19, 2026
Fixed by #3410: bindings carry Opus frame durations in microseconds (
frame_duration_us), so 2.5 ms round-trips, with a C regression test.(Written by Claude Opus 5.5)