Voice 3: fluxer-audio crate — frames and DSP #64

Closed
opened 2026-11-11 12:17:32 +00:00 by charles · 0 comments
Owner

Files:

  • Create: crates/fluxer-audio/{Cargo.toml,README.md}, src/{lib.rs,frame.rs,resample.rs,gain.rs,gate.rs,level.rs,softclip.rs,denoise.rs,chain.rs}
  • Modify: workspace Cargo.toml (member + nnnoiseless, rubato), deny.toml if a licence is new
  • Test: crates/fluxer-audio/tests/dsp.rs

Interfaces:

  • Produces: Frame { samples: Vec<i16>, channels: u8 } (48 kHz, 10 ms); Resampler::new(from_hz, to_hz, channels); gain::user_volume_gain(percent: f32) -> f32 (facts §3 curve), gain::percent(p) -> f32; Gate::new(GateConfig { mode: Auto | Manual { threshold_rms }, attack_ms: 5, release_ms: 20, hold_ms: 180, lookahead_ms: 10 }), gate::threshold_rms_for_slider(0..=100) (0.0003 / 0.008 / 0.04, log interpolation); LevelDetector::new(DetectorConfig) with remote_threshold_rms_for_slider (0.002 / 0.006 / 0.035), 30 ms attack / 220 ms release; soft_clip(&mut [f32]); Denoiser::{Rnnoise, None}; CaptureChain::new(ChainConfig { denoise, gate: Option<GateConfig>, input_volume_percent, stereo }) -> CaptureChain, fn process(&mut self, frame: &mut Frame) -> ChainOutput { rms, gate_open }.

  • Step 1: Write failing tests: user_volume_curve_reference_points (0→10^-1.2, 50→10^-0.6, 100→1, 150→2, 200→4, tolerance 1e-4), gate_opens_within_attack_and_holds_180ms, auto_gate_tracks_noise_floor, manual_threshold_slider_points, level_detector_attack_release, soft_clip_never_exceeds_one, resampler_44100_to_48000_keeps_duration, rnnoise_reduces_white_noise_energy, chain_applies_input_volume_after_gate.

  • Step 2–5: FAIL → implement → PASS → commit feat(audio): frames and microphone DSP chain.

Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md
Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md

**Files:** - Create: `crates/fluxer-audio/{Cargo.toml,README.md}`, `src/{lib.rs,frame.rs,resample.rs,gain.rs,gate.rs,level.rs,softclip.rs,denoise.rs,chain.rs}` - Modify: workspace `Cargo.toml` (member + `nnnoiseless`, `rubato`), `deny.toml` if a licence is new - Test: `crates/fluxer-audio/tests/dsp.rs` **Interfaces:** - Produces: `Frame { samples: Vec<i16>, channels: u8 }` (48 kHz, 10 ms); `Resampler::new(from_hz, to_hz, channels)`; `gain::user_volume_gain(percent: f32) -> f32` (facts §3 curve), `gain::percent(p) -> f32`; `Gate::new(GateConfig { mode: Auto | Manual { threshold_rms }, attack_ms: 5, release_ms: 20, hold_ms: 180, lookahead_ms: 10 })`, `gate::threshold_rms_for_slider(0..=100)` (0.0003 / 0.008 / 0.04, log interpolation); `LevelDetector::new(DetectorConfig)` with `remote_threshold_rms_for_slider` (0.002 / 0.006 / 0.035), 30 ms attack / 220 ms release; `soft_clip(&mut [f32])`; `Denoiser::{Rnnoise, None}`; `CaptureChain::new(ChainConfig { denoise, gate: Option<GateConfig>, input_volume_percent, stereo }) -> CaptureChain`, `fn process(&mut self, frame: &mut Frame) -> ChainOutput { rms, gate_open }`. - [ ] **Step 1: Write failing tests**: `user_volume_curve_reference_points` (0→10^-1.2, 50→10^-0.6, 100→1, 150→2, 200→4, tolerance 1e-4), `gate_opens_within_attack_and_holds_180ms`, `auto_gate_tracks_noise_floor`, `manual_threshold_slider_points`, `level_detector_attack_release`, `soft_clip_never_exceeds_one`, `resampler_44100_to_48000_keeps_duration`, `rnnoise_reduces_white_noise_energy`, `chain_applies_input_volume_after_gate`. - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(audio): frames and microphone DSP chain`. Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md
charles added this to the Voice milestone 2026-11-11 12:17:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#64
No description provided.