[][src]Function mp3_duration::from_file

pub fn from_file(file: &File) -> Result<Duration, MP3DurationError>

Measures the duration of a file.

Examples

use std::path::Path;
use std::fs::File;
use mp3_duration;

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