Struct bliss_audio::Analysis[][src]

pub struct Analysis { /* fields omitted */ }
Expand description

Object holding the results of the song’s analysis.

Only use it if you want to have an in-depth look of what is happening behind the scene, or make a distance metric yourself.

Under the hood, it is just an array of f32 holding different numeric features.

For more info on the different features, build the documentation with private items included using cargo doc --document-private-items, and / or read up this document, that contains a description on most of the features, except the chroma ones, which are documented directly in this code.

Implementations

Create a new Analysis object.

Usually not needed, unless you have already computed and stored features somewhere, and need to recreate a Song with an already existing Analysis yourself.

Return an ndarray Array1 representing the analysis’ features.

Particularly useful if you want to make a custom distance metric.

Return a Vec representing the analysis’ features.

Particularly useful if you want iterate through the values to store them somewhere.

Compute distance between two analysis using a user-provided distance metric. You most likely want to use song.custom_distance directly rather than this function.

For this function to be integrated properly with the rest of bliss’ parts, it should be a valid distance metric, i.e.:

  1. For X, Y real vectors, d(X, Y) = 0 ⇔ X = Y
  2. For X, Y real vectors, d(X, Y) >= 0
  3. For X, Y real vectors, d(X, Y) = d(Y, X)
  4. For X, Y, Z real vectors d(X, Y) ≤ d(X + Z) + d(Z, Y)

Note that almost all distance metrics you will find obey these properties, so don’t sweat it too much.

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

The returned type after indexing.

Performs the indexing (container[index]) operation. 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

Should always be Self

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)

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.