Skip to main content

Crate timestretch

Crate timestretch 

Source
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§

AppliedParameters
DurationRatio
Output time / source time, from 0.25 to 32. Inverse of TempoRate.
Epoch
OutputConsumption
OutputStamp
OwnedMemory
Heap-owned buffers and boxed states. Allocator overhead, host queues and opaque FFT plans are separate; None does not mean zero plan memory.
Parameters
PitchRatio
Frequency multiplier, from 0.25 to 4 (−24 to +24 semitones).
PreparedSession
Allocates and validates everything before a host starts processing.
ProcessReport
RenderReport
RenderedAudio
SessionConfig
SessionCounters
SourceRequest
StreamSession
Owns DSP and transport semantics. Hosts own thread scheduling and device queues.
TempoRate
Source time / output time, from 1/32 to 4. Zero speed is a transport action.
TimingInfo
TransitionEnvelope
Small reusable transition ramp. Hosts supply the last delivered frame; generation never reads DSP buffers or allocates.

Enums§

Backend
ProcessStatus
RatePolicy
RatioConstraint
SessionError
SourceAccess
Transport

Functions§

render
Render interleaved samples without normalization or a second DSP path.

Type Aliases§

SessionResult