Expand description
timestretch time/pitch processing through one host-driven session.
use timestretch::{render, Backend, Parameters, SessionConfig, TempoRate};
let config = SessionConfig {
channels: 1,
backend: Backend::Portable,
parameters: Parameters::keylock(TempoRate::new(0.75)?),
..SessionConfig::default()
};
let audio = render(&vec![0.0; 4410], config)?;
assert!(audio.samples.len() > 4410);Preparation allocates. StreamSession processing is synchronous and bounded
by a work quota; the host chooses its thread and scheduling policy. Offline
rendering drives exactly the same adapter. Source frames, collected output,
and acknowledged playback progress are distinct. See examples/realtime_stream.rs.
Re-exports§
pub use error::StretchError;
Modules§
- error
- Error types for the timestretch crate.
Structs§
- Applied
Parameters - Duration
Ratio - Output time / source time, from 0.25 to 32. Inverse of TempoRate.
- Epoch
- Output
Consumption - Output
Stamp - Owned
Memory - Heap-owned buffers and boxed states. Allocator overhead, host queues and
opaque FFT plans are separate;
Nonedoes not mean zero plan memory. - Parameters
- Pitch
Ratio - Frequency multiplier, from 0.25 to 4 (−24 to +24 semitones).
- Prepared
Session - Allocates and validates everything before a host starts processing.
- Process
Report - Render
Report - Rendered
Audio - Session
Config - Session
Counters - Source
Request - Stream
Session - Owns DSP and transport semantics. Hosts own thread scheduling and device queues.
- Tempo
Rate - Source time / output time, from 1/32 to 4. Zero speed is a transport action.
- Timing
Info - Transition
Envelope - Small reusable transition ramp. Hosts supply the last delivered frame; generation never reads DSP buffers or allocates.
Enums§
Functions§
- render
- Render interleaved samples without normalization or a second DSP path.