Function from_path

Source
pub fn from_path<P>(path: P) -> Result<Duration, MP3DurationError>
where P: AsRef<Path>,
Expand description

Measures the duration of a file.

ยงExamples

use std::path::Path;
use mp3_duration;

let path = Path::new("test/source.mp3");
let duration = mp3_duration::from_path(&path).unwrap();
println!("File duration: {:?}", duration);