Trait babycat::Signal

source ·
pub trait Signal {
    // Required methods
    fn frame_rate_hz(&self) -> u32;
    fn num_channels(&self) -> u16;
    fn num_frames_estimate(&self) -> Option<usize>;

    // Provided methods
    fn duration_estimate(&self) -> Option<Duration> { ... }
    fn duration_estimate_to_str(&self) -> String { ... }
}
Expand description

A trait that describes common properties of all digital audio signals.

Required Methods§

source

fn frame_rate_hz(&self) -> u32

The frame rate (or sample rate) of the Signal, measured in frames per second.

source

fn num_channels(&self) -> u16

The number of audio channels in the Signal.

source

fn num_frames_estimate(&self) -> Option<usize>

An estimate of the total number of frames in the Signal.

Provided Methods§

source

fn duration_estimate(&self) -> Option<Duration>

The wall-clock duration of this Signal, based on the estimated number of frames.

source

fn duration_estimate_to_str(&self) -> String

A string representation of this Signal’s wall-clock duration.

Implementations on Foreign Types§

source§

impl<L, R> Signal for Either<L, R>where L: Signal, R: Signal,

This allows us to use the Either enum for Signal objects.

source§

impl Signal for Box<dyn Source + '_>

Implementors§