From a6ca665fdffd5b5ffbeccb3dd16aac358fa3c917 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 27 Apr 2023 00:54:43 +0200 Subject: [PATCH] docs: add docstring to loudness_db parameter --- src/model/mod.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/model/mod.rs b/src/model/mod.rs index 89ad012..9d60374 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -256,9 +256,20 @@ pub struct AudioStream { pub codec: AudioCodec, /// Number of audio channels pub channels: Option, - /// Loudness + /// Audio loudness for ReplayGain correction /// - /// Not available when using the Android client + /// The track volume correction factor (0-1) can be calculated using this formula + /// + /// `10^(-loudness_db/20)` + /// + /// Note that the value is the inverse of the usual track gain parameter, i.e. a + /// value of 6 means the volume should be reduced by 6dB and the ReplayGain track gain + /// parameter would be -6. + /// + /// More information about ReplayGain and how to apply this infomation to audio files + /// can be found here: . + /// + /// The loudness parameter is not available when using the Android client. pub loudness_db: Option, /// True if the deobfuscation of the nsig url parameter failed /// and the stream will be throttled