Struct bliss_rs::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: Vec<f32>, }
Expand description
Simple object used to represent a Song, with its path, analysis, and other metadata (artist, genre…)
Fields
path: String
Expand description
Song’s provided file path
artist: String
Expand description
Song’s artist, read from the metadata (""
if empty)
title: String
Expand description
Song’s title, read from the metadata (""
if empty)
album: String
Expand description
Song’s album name, read from the metadata (""
if empty)
track_number: String
Expand description
Song’s tracked number, read from the metadata (""
if empty)
genre: String
Expand description
Song’s genre, read from the metadata (""
if empty)
analysis: Vec<f32>
Expand description
Vec containing analysis, in order: tempo, zero-crossing rate, mean spectral centroid, std deviation spectral centroid, mean spectral rolloff, std deviation spectral rolloff mean spectral_flatness, std deviation spectral flatness, mean loudness, std deviation loudness, chroma interval feature 1 to 10.
All the numbers are between -1 and 1.
Implementations
impl Song
[src]
impl Song
[src]pub fn distance(&self, other: &Self) -> f32
[src]
pub fn distance(&self, other: &Self) -> f32
[src]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.
pub fn new(path: &str) -> Result<Self, BlissError>
[src]
pub fn new(path: &str) -> Result<Self, BlissError>
[src]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
impl StructuralPartialEq for Song
[src]
Auto Trait Implementations
impl RefUnwindSafe for Song
impl Send for Song
impl Sync for Song
impl Unpin for Song
impl UnwindSafe for Song
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,