[][src]Function mp3_duration::from_path

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

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);