mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-01-05 02:18:51 +00:00
16 lines
362 B
Rust
16 lines
362 B
Rust
|
//! # MP3 utilities
|
||
|
//!
|
||
|
//! @author Pierre Hubert
|
||
|
|
||
|
/// Check out whether a file is a valid MP3 file or not
|
||
|
pub fn is_valid_mp3(file: &[u8]) -> bool {
|
||
|
let res = mp3_metadata::read_from_slice(file);
|
||
|
|
||
|
match res {
|
||
|
Ok(_) => true,
|
||
|
Err(e) => {
|
||
|
eprintln!("Error while parsing MP3 file ! {:#?}", e);
|
||
|
false
|
||
|
}
|
||
|
}
|
||
|
}
|