Struct blip_buf::BlipBuf [] [src]

pub struct BlipBuf { /* fields omitted */ }

Sample buffer that resamples from input clock rate to output sample rate

Methods

impl BlipBuf
[src]

Creates new buffer that can hold at most sample_count samples. Sets rates so that there are MAX_RATIO clocks per sample. Returns pointer to new buffer, or panics if insufficient memory.

Sets approximate input clock rate and output sample rate. For every clock_rate input clocks, approximately sample_rate samples are generated.

Clears entire buffer. Afterwards, samples_avail() == 0.

Adds positive/negative delta into buffer at specified clock time.

Same as add_delta(), but uses faster, lower-quality synthesis.

Length of time frame, in clocks, needed to make sample_count additional samples available.

Makes input clocks before clock_duration available for reading as output samples. Also begins new time frame at clock_duration, so that clock time 0 in the new time frame specifies the same clock as clock_duration in the old time frame specified. Deltas can have been added slightly past clock_duration (up to however many clocks there are in two output samples).

Number of buffered samples available for reading.

Reads and removes at most buf.len() samples and writes them to buf. If stereo is true, writes output to every other element of buf, allowing easy interleaving of two buffers into a stereo sample stream. Outputs 16-bit signed samples. Returns number of samples actually read.

Trait Implementations

impl Send for BlipBuf
[src]

impl Drop for BlipBuf
[src]

A method called when the value goes out of scope. Read more