mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Add warning about Normalisation Attack or Release being to small
This commit is contained in:
parent
2fa2bf86cb
commit
c29ec3f473
1 changed files with 22 additions and 16 deletions
|
@ -46,23 +46,29 @@ struct DynamicNormalisation {
|
||||||
impl DynamicNormalisation {
|
impl DynamicNormalisation {
|
||||||
fn new(config: &PlayerConfig) -> Self {
|
fn new(config: &PlayerConfig) -> Self {
|
||||||
// as_millis() has rounding errors (truncates)
|
// as_millis() has rounding errors (truncates)
|
||||||
debug!(
|
let attack = config
|
||||||
"Normalisation Attack: {:.0} ms",
|
|
||||||
config
|
|
||||||
.sample_rate
|
.sample_rate
|
||||||
.normalisation_coefficient_to_duration(config.normalisation_attack_cf)
|
.normalisation_coefficient_to_duration(config.normalisation_attack_cf)
|
||||||
.as_secs_f64()
|
.as_secs_f64()
|
||||||
* 1000.
|
* 1000.0;
|
||||||
);
|
|
||||||
|
|
||||||
debug!(
|
if attack < 1.0 {
|
||||||
"Normalisation Release: {:.0} ms",
|
warn!("Normalisation Attack: {:.0} ms, an Attack of < 1.0 ms will cause severe distortion", attack);
|
||||||
config
|
} else {
|
||||||
|
debug!("Normalisation Attack: {:.0} ms", attack);
|
||||||
|
}
|
||||||
|
|
||||||
|
let release = config
|
||||||
.sample_rate
|
.sample_rate
|
||||||
.normalisation_coefficient_to_duration(config.normalisation_release_cf)
|
.normalisation_coefficient_to_duration(config.normalisation_release_cf)
|
||||||
.as_secs_f64()
|
.as_secs_f64()
|
||||||
* 1000.
|
* 1000.0;
|
||||||
);
|
|
||||||
|
if release < 1.0 {
|
||||||
|
warn!("Normalisation Release: {:.0} ms, a Release of < 1.0 ms will cause severe distortion", release);
|
||||||
|
} else {
|
||||||
|
debug!("Normalisation Release: {:.0} ms", release);
|
||||||
|
}
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
threshold_db: config.normalisation_threshold_dbfs,
|
threshold_db: config.normalisation_threshold_dbfs,
|
||||||
|
|
Loading…
Reference in a new issue