mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
audio: expose WAV signature detection
This commit is contained in:
1 parent
8e394d43fa
commit
badb790411
1 file changed
+5
@@ -5,6 +5,11 @@
|
||||
use crate::{AudioError, Result};
|
||||
use craft_media::ByteSource;
|
||||
|
||||
/// Whether a prefix identifies a RIFF or RF64 WAVE file.
|
||||
pub fn sniff(b: &[u8]) -> bool {
|
||||
b.len() >= 12 && (&b[0..4] == b"RIFF" || &b[0..4] == b"RF64") && &b[8..12] == b"WAVE"
|
||||
}
|
||||
|
||||
const MAX_CHUNKS: usize = 1 << 16;
|
||||
const IXML_MAX: u64 = 1 << 20;
|
||||
/// Maximum sample data returned by a single range read.
|
||||
|
||||
Reference in new issue
Block a user