Skip to main content

volume_to_percent

Function volume_to_percent 

Source
pub fn volume_to_percent(volume: f64) -> f64
Expand description

Convert normalized volume (0.0-1.0) to percentage (0-100)

Used when sending volume to Jellyfin remote sessions, MPV, or ExoPlayer. Values outside the 0.0-1.0 range are clamped.

§Arguments

  • volume - Normalized volume (0.0 to 1.0)

§Returns

Volume as percentage (0 to 100), floored to integer value

§Example

let percent = volume_to_percent(0.75); // 75.0