fix(audio): preserve full sample boundaries for one-shot playback
This commit is contained in:
+12
@@ -46,6 +46,18 @@ The mixer also reduces large pitch steps before multiplication when wrapping loo
|
||||
|
||||
## Evidence and Limits
|
||||
|
||||
### Sample Metadata Does Not Select Playback Mode
|
||||
|
||||
Loop markers describe an optional interval within a sample; the playback command decides whether to use it. Applying a loop end to one-shot playback silently discards the tail, even though the data remains available. The mixer now selects the full sample boundary when looping is off. When looping is on, a complete interval satisfying `start < end <= length` preserves the intro and wraps at the selected end; absent, partial or invalid markers fall back to the full sample. Empty samples terminate before indexing.
|
||||
|
||||
Interpolation follows the same selected boundary. A one-shot interpolates into the actual tail and finally toward zero, while a loop seam interpolates toward the loop-start frame. Distinct intro, loop and tail values make these behaviors observable: an eight-frame sample with markers `(2, 4)` emits all eight frames once with looping off, and emits frame indices `0, 1, 2, 3, 2, 3, 2, 3` with looping on. Constant PCM alone cannot detect this defect.
|
||||
|
||||
The correction derives from DEC-0060 in DSC-0064. Synthetic regressions cover exact PCM, fractional seams and tails, incomplete and invalid markers, empty samples, rate conversion, multiple wraps and extreme finite pitch. These tests exercise the existing delivery and control paths without establishing new device timing or reclamation guarantees. The [sample contract](../../../docs/specs/runtime/05-audio-peripheral.md#6-samples-interpolation-and-ownership) remains normative.
|
||||
|
||||
Local macOS/aarch64 qualification on 2026-10-14 passed 19 host audio tests (one physical-device test ignored), nine driver audio tests and ten runtime audio tests. The existing `make ci-domains` target passed with 1,027 tests passed, zero failed and 11 ignored, including all 15 domain gates. Strict all-target/all-feature Clippy passed for the desktop host. Strict workspace qualification remains pending because of existing VM lint errors; this correction does not claim to resolve the repository-wide quality gate.
|
||||
|
||||
### Original Voice-Control Qualification
|
||||
|
||||
Validation was run locally on macOS/aarch64 on 2026-10-14:
|
||||
|
||||
- `cargo test --workspace --all-targets --all-features --no-fail-fast`: **1,016 passed**, zero failed, eleven ignored across 55 reported suites.
|
||||
|
||||
Reference in New Issue
Block a user