Struct bliss_audio::Song[][src]

pub struct Song {
    pub path: String,
    pub artist: String,
    pub title: String,
    pub album: String,
    pub track_number: String,
    pub genre: String,
    pub analysis: Analysis,
}
Expand description

Simple object used to represent a Song, with its path, analysis, and other metadata (artist, genre…)

Fields

path: String

Song’s provided file path

artist: String

Song’s artist, read from the metadata ("" if empty)

title: String

Song’s title, read from the metadata ("" if empty)

album: String

Song’s album name, read from the metadata ("" if empty)

track_number: String

Song’s tracked number, read from the metadata ("" if empty)

genre: String

Song’s genre, read from the metadata ("" if empty)

analysis: Analysis

bliss analysis results

Implementations

Compute the distance between the current song and any given Song.

The smaller the number, the closer the songs; usually more useful if compared between several songs (e.g. if song1.distance(song2) < song1.distance(song3), then song1 is closer to song2 than it is to song3.

Returns a decoded Song given a file path, or an error if the song could not be analyzed for some reason.

Arguments

  • path - A string holding a valid file path to a valid audio file.

Errors

This function will return an error if the file path is invalid, if the file path points to a file containing no or corrupted audio stream, or if the analysis could not be conducted to the end for some reason.

The error type returned should give a hint as to whether it was a decoding (DecodingError) or an analysis (AnalysisError) error.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.