Compare commits
No commits in common. "2809f9e4952878ff15a3c011b87006e12a122fde" and "f3b9075a820fe2754a2132e0c324e3ad0e8a75cb" have entirely different histories.
2809f9e495
...
f3b9075a82
Binary file not shown.
@ -129,15 +129,3 @@ pub fn detect_audio_type(buffer: &[u8]) -> Result<AudioType, AudioError> {
|
|||||||
|
|
||||||
Ok(AudioType::Unknown)
|
Ok(AudioType::Unknown)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use crate::{detect_audio_type, AudioType};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_mp3() {
|
|
||||||
let mp3_data = include_bytes!("__fixtures__/mp3_with_id3v2.bin");
|
|
||||||
let result = detect_audio_type(mp3_data).expect("failed to parse mp3");
|
|
||||||
assert_eq!(result, AudioType::MP3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -67,7 +67,7 @@ fn get_ape_v2_size(buffer: &[u8], offset: usize) -> Result<usize, AudioError> {
|
|||||||
|
|
||||||
pub fn get_header_metadata_size(buffer: &[u8], offset: usize) -> Result<usize, AudioError> {
|
pub fn get_header_metadata_size(buffer: &[u8], offset: usize) -> Result<usize, AudioError> {
|
||||||
let len = get_id3_header_size(buffer, offset)?;
|
let len = get_id3_header_size(buffer, offset)?;
|
||||||
if len != 0 {
|
if len == 0 {
|
||||||
Ok(len)
|
Ok(len)
|
||||||
} else {
|
} else {
|
||||||
get_ape_v2_size(buffer, offset)
|
get_ape_v2_size(buffer, offset)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@unlock-music/crypto",
|
"name": "@unlock-music/crypto",
|
||||||
"version": "0.0.0-alpha.8",
|
"version": "0.0.0-alpha.7",
|
||||||
"description": "Project Unlock Music: 加解密支持库",
|
"description": "Project Unlock Music: 加解密支持库",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node build.js",
|
"build": "node build.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user