Struct songbird::input::Input[][src]

pub struct Input {
    pub metadata: Box<Metadata>,
    pub stereo: bool,
    pub reader: Reader,
    pub kind: Codec,
    pub container: Container,
    // some fields omitted
}

Data and metadata needed to correctly parse a Reader’s audio bytestream.

See the module root for more information.

Fields

metadata: Box<Metadata>

Information about the played source.

stereo: bool

Indicates whether source is stereo or mono.

reader: Reader

Underlying audio data bytestream.

kind: Codec

Decoder used to parse the output of reader.

container: Container

Framing strategy needed to identify frames of compressed audio.

Implementations

impl Input[src]

pub fn float_pcm(is_stereo: bool, reader: Reader) -> Input

Notable traits for Input

impl Read for Input
[src]

Creates a floating-point PCM Input from a given reader.

pub fn new(
    stereo: bool,
    reader: Reader,
    kind: Codec,
    container: Container,
    metadata: Option<Metadata>
) -> Self
[src]

Creates a new Input using (at least) the given reader, codec, and container.

pub fn is_seekable(&self) -> bool[src]

Returns whether the inner Reader implements Seek.

pub fn is_stereo(&self) -> bool[src]

Returns whether the read audio signal is stereo (or mono).

pub fn get_type(&self) -> CodecType[src]

Returns the type of the inner Codec.

pub fn mix(&mut self, float_buffer: &mut [f32; 1920], volume: f32) -> usize[src]

Mixes the output of this stream into a 20ms stereo audio buffer.

pub fn seek_time(&mut self, time: Duration) -> Option<Duration>[src]

Seeks the stream to the given time, if possible.

Returns the actual time reached.

Trait Implementations

impl Debug for Input[src]

impl From<Compressed> for Input[src]

impl From<Restartable> for Input[src]

impl Read for Input[src]

impl Seek for Input[src]

impl TryFrom<Memory> for Input[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl !RefUnwindSafe for Input

impl Send for Input

impl !Sync for Input

impl Unpin for Input

impl !UnwindSafe for Input

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]

impl<R> ReadSeek for R where
    R: Read + Seek
[src]

impl<R> ReadSkipExt for R where
    R: Read
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]