Struct replaygain::ReplayGain [] [src]

pub struct ReplayGain { /* fields omitted */ }

Methods

impl ReplayGain
[src]

Create a new ReplayGain filter for the given sample rate. Returns None if the sample rate is not supported.

Returns the size of a single audio frame (one of which we analyze at a time) in floats. Note that because we expect stereo audio, this means that you need to divide this by 2 to get the number of samples.

Processes a single audio frame.

Panics

Panics if frame.len() != self.frame_size() or if there's anything in process_samples's buffer. If you need buffering, use process_samples() and only that instead.

Processes a given amount of audio samples.

Note that because we expect stereo audio, it doesn't actually make sense to pass an odd number of floats to this function but we buffer it to chunks of frame_size() anyways so we don't care.

Completes the analysis and returns the two replaygain values (gain, peak).