Struct sample::interpolate::Converter[][src]

pub struct Converter<S, I> where
    S: Signal,
    I: Interpolator
{ /* fields omitted */ }

An iterator that converts the rate at which frames are yielded from some given frame Interpolator into a new type.

Other names for sample::interpolate::Converter might include:

  • Sample rate converter
  • {Up/Down}sampler
  • Sample interpolater
  • Sample decimator

Methods

impl<S, I> Converter<S, I> where
    S: Signal,
    I: Interpolator
[src]

Construct a new Converter from the source frames and the source and target sample rates (in Hz).

Construct a new Converter from the source frames and the amount by which the current playback rate (not sample rate) should be multiplied to reach the new playback rate.

For example, if our source_frames is a sine wave oscillating at a frequency of 2hz and we wanted to convert it to a frequency of 3hz, the given scale should be 1.5.

Construct a new Converter from the source frames and the amount by which the current sample rate (not playback rate) should be multiplied to reach the new sample rate.

If our source_frames are being sampled at a rate of 44_100hz and we want to convert to a sample rate of 96_000hz, the given scale should be 96_000.0 / 44_100.0.

This is the same as calling Converter::scale_playback_hz(source_frames, 1.0 / scale).

Update the source_to_target_ratio internally given the source and target hz.

This method might be useful for changing the sample rate during playback.

Update the source_to_target_ratio internally given a new playback rate multiplier.

This method is useful for dynamically changing rates.

Update the source_to_target_ratio internally given a new sample rate multiplier.

This method is useful for dynamically changing rates.

Borrow the source_frames Interpolator from the Converter.

Mutably borrow the source_frames Iterator from the Converter.

Drop self and return the internal source_frames Iterator.

Trait Implementations

impl<S: Clone, I: Clone> Clone for Converter<S, I> where
    S: Signal,
    I: Interpolator
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<S, I> Signal for Converter<S, I> where
    S: Signal,
    I: Interpolator<Frame = S::Frame>, 
[src]

The Frame type returned by the Signal.

Yield the next Frame in the Signal. Read more

Whether or not the signal is exhausted of meaningful frames. Read more

A signal that maps one set of frames to another. Read more

A signal that maps one set of frames to another. Read more

Provides an iterator that yields the sum of the frames yielded by both other and self in lock-step. Read more

Provides an iterator that yields the product of the frames yielded by both other and self in lock-step. Read more

Provides an iterator that offsets the amplitude of every channel in each frame of the signal by some sample value and yields the resulting frames. Read more

Produces an Iterator that scales the amplitude of the sample of each channel in every Frame yielded by self by the given amplitude. Read more

Produces a new Signal that offsets the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp_frame. Read more

Produces a new Signal that scales the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp_frame. Read more

Multiplies the rate at which frames of self are yielded by the given signal. Read more

Converts the rate at which frames of the Signal are yielded using interpolation. Read more

Multiplies the rate at which frames of the Signal are yielded by the given value. Read more

Delays the Signal by the given number of frames. Read more

Converts a Signal into a type that yields the interleaved Samples. Read more

Clips the amplitude of each channel in each Frame yielded by self to the given threshold amplitude. Read more

Create a new Signal that calls the enclosing function on each iteration. Read more

Forks Self into two signals that produce the same frames. Read more

Moves the Signal into a Bus from which its output may be divided into multiple other Signals in the form of Outputs. Read more

Important traits for Take<S>

Converts the Signal into an Iterator that will yield the given number for Frames before returning None. Read more

Important traits for UntilExhausted<S>

Converts the Signal into an Iterator yielding frames until the signal.is_exhausted() returns true. Read more

Buffers the signal using the given ring buffer. Read more

An adaptor that yields the RMS of the signal. Read more

An adaptor that detects and yields the envelope of the signal. Read more

Borrows a Signal rather than consuming it. Read more

Auto Trait Implementations

impl<S, I> Send for Converter<S, I> where
    I: Send,
    S: Send

impl<S, I> Sync for Converter<S, I> where
    I: Sync,
    S: Sync