Struct FileAnalysis

Source
pub struct FileAnalysis {
Show 30 fields pub path: String, pub source: String, pub source_version: u32, pub imported_at: u64, pub result_at_ns: u64, pub size_bytes: u64, pub modified_unix: u64, pub file_md5: Option<String>, pub source_data: Option<Json>, pub md5_state: Option<String>, pub md5_detail: Option<String>, pub real_bit_depth: Option<u16>, pub requant_rate: Option<f64>, pub fake_stereo: Option<bool>, pub ext_mismatch: Option<bool>, pub transcoding: Option<String>, pub upscaling: Option<bool>, pub upsampling: Option<bool>, pub summary: Option<String>, pub detail: Option<String>, pub cutoff_hz: Option<f64>, pub cutoff_ratio: Option<f64>, pub dr_db: Option<f64>, pub peak_dbfs: Option<f64>, pub true_peak_dbtp: Option<f64>, pub integrated_lufs: Option<f64>, pub clipped_samples: Option<u64>, pub clip_events: Option<u64>, pub clipped: Option<bool>, pub error: Option<String>,
}
Expand description

One file, as FlacCompagnon measured it.

Every measurement is optional: a report may predate a field, omit one, or come from a tool that does not compute it. Nothing here is required for the catalog to work — this is entirely additional.

Fields§

§path: String

Absolute path of the file this describes.

The primary key is the path, not an identifier into the catalog. Two reasons, and the second is the important one. Identifiers are positions that a scan renumbers, so an identifier would have to be remapped after every scan. And an analysis may perfectly well describe a file the catalog does not hold yet: someone can run the analysis first and build their library afterwards. Keying on the path lets such a record wait, and attach itself the day the file is scanned. A whole-file MD5 can identify a renamed copy when the old path no longer exists.

§source: String

Tool that produced the measurements, flaccompagnon for now.

§source_version: u32

Version of the report format, kept so an old import stays readable.

§imported_at: u64

When it was imported, in seconds since the Unix epoch.

§result_at_ns: u64

Original report modification time, or in-process measurement completion, in nanoseconds since the Unix epoch. Zero means an older stored result whose date is unknown. Distinct from the audio file’s own mtime.

§size_bytes: u64

Size the analysed file had, in bytes.

With FileAnalysis::modified_unix, this makes an exact-path or legacy name-and-size match expire when the file changes. A moved file with a matching whole-file MD5 can keep its analysis after a timestamp change.

§modified_unix: u64

Modification date the analysed file had.

§file_md5: Option<String>

MD5 of the entire file, including tags and artwork, when supplied. Used to identify a moved file without trusting its name or timestamp.

§source_data: Option<Json>

Complete file entry from the source report, including measurements that Aède does not interpret yet. It keeps the source path when a matching file is later moved; FileAnalysis::path is the attached path.

§md5_state: Option<String>

Verdict on the MD5 stored in STREAMINFO: Match, Mismatch, NoSignature, Present, Error.

A state, not a hash — the tool compares and reports, it does not publish the digest. Match is equivalent to a successful flac -t.

§md5_detail: Option<String>

What went wrong, when the state is an error.

§real_bit_depth: Option<u16>

Bit depth actually carried, as measured by decoding.

§requant_rate: Option<f64>

Proportion of samples that show requantisation.

§fake_stereo: Option<bool>

Both channels hold the same signal.

§ext_mismatch: Option<bool>

The extension does not match the container found inside.

§transcoding: Option<String>

The file was made from a lower-resolution source: none, suspected, detected.

§upscaling: Option<bool>

A lossless file built from a lossy one.

§upsampling: Option<bool>

Sample rate raised above what the content justifies.

§summary: Option<String>

One-word verdict, as the tool words it.

§detail: Option<String>

The same verdict in a sentence, worth showing as it stands.

§cutoff_hz: Option<f64>

Frequency where the spectrum stops, in hertz. A cutoff well below half the sample rate is the signature of a lossy ancestry.

§cutoff_ratio: Option<f64>

That frequency as a fraction of the Nyquist limit.

§dr_db: Option<f64>

Dynamic range in decibels: the lower, the more compressed the master.

§peak_dbfs: Option<f64>

Highest sample value, in dBFS.

§true_peak_dbtp: Option<f64>

True peak, in dBTP — what a converter will actually have to produce.

§integrated_lufs: Option<f64>

FlacCompagnon’s measured integrated track loudness, in LUFS.

§clipped_samples: Option<u64>

Samples sitting at full scale.

§clip_events: Option<u64>

Runs of consecutive clipped samples.

§clipped: Option<bool>

The tool’s own conclusion on clipping.

§error: Option<String>

What stopped the analysis of this file, when something did.

Implementations§

Source§

impl FileAnalysis

Source

pub fn still_applies(&self, size: u64, mtime: u64) -> bool

true when the analysis still describes the file as it is now.

Uses the source report’s unchanged size and whole-second modification date. Unlike the scanner’s native cache identity, this contract has no subsecond precision and cannot distinguish all same-second edits.

Source

pub fn md5_failed(&self) -> bool

true when the decoded audio did not match the file’s own MD5.

Source

pub fn suspect_encoding(&self) -> bool

true when the file is suspected of being built from a lossy source.

Source

pub fn file_name(&self) -> &str

Last component of FileAnalysis::path.

With the size, this is what identifies a file that has moved since it was analysed — a name and a byte count together are very nearly unique in a music library.

Trait Implementations§

Source§

impl Clone for FileAnalysis

Source§

fn clone(&self) -> FileAnalysis

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileAnalysis

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FileAnalysis

Source§

fn default() -> FileAnalysis

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

impl PartialEq for FileAnalysis

Source§

fn eq(&self, other: &FileAnalysis) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FileAnalysis

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,