[][src]Module bae_rs::utils

Utils

Module for audio related functions and types that make life easier.

Re-exports

pub use mono_resampler::*;

Modules

mono_resampler

MonoResampler

Functions

db_to_linear

Converts from a decibel (dBFS) to a linear gain value

lerp

Linear interpolation (y-y1 = m * (x-x1)) of a given value.

linear_to_db

Converts from a linear gain value to a decibel (dBFS) value.

normalize

Normalizes the given audio track to have a peak value at the given dBFS value.

read_wav

Takes the given path and reads the track data from the WAV file at the given location.

samples_to_seconds

Converts a given sample count to seconds.

seconds_to_samples

Converts the given duration to samples, rounded to the nearest sample.

write_wav

Takes the given track and filename and writes the track data to the WAV file at the given location with a given bit-depth.