From b3d35c8c1a83da5216805ec83587270f1eec958e Mon Sep 17 00:00:00 2001 From: thed0ct0r Date: Mon, 28 Apr 2025 23:08:39 +0300 Subject: [PATCH] Update audio.rs Added: ID3V1 support For some reason only 0xFF 0xFB was supported, while https://en.wikipedia.org/wiki/List_of_file_signatures also lists 0xFF 0xF2 and 0xFF 0xF3 --- src/matchers/audio.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/matchers/audio.rs b/src/matchers/audio.rs index 73cfed4..c12b873 100644 --- a/src/matchers/audio.rs +++ b/src/matchers/audio.rs @@ -8,7 +8,10 @@ pub fn is_mp3(buf: &[u8]) -> bool { buf.len() > 2 && ((buf[0] == 0x49 && buf[1] == 0x44 && buf[2] == 0x33) // ID3v2 // Final bit (has crc32) may be or may not be set. - || (buf[0] == 0xFF && buf[1] == 0xFB)) + // ID3V1 Support + || (buf[0] == 0xFF && buf[1] == 0xFB) + || (buf[0] == 0xFF && buf[1] == 0xF3) + || (buf[0] == 0xFF && buf[1] == 0xF2)) } /// Returns whether a buffer is M4A data.