pub struct FormatDetector;Expand description
Audio format detector using hybrid magic-byte + Symphonia validation.
Implementations§
Source§impl FormatDetector
impl FormatDetector
Sourcepub fn detect(data: &[u8]) -> Result<AudioMetadata>
pub fn detect(data: &[u8]) -> Result<AudioMetadata>
Detect audio format from byte stream using fast magic-byte detection.
This is the primary entry point optimized for speed (<1µs for common formats). Falls back to Symphonia validation for complex/ambiguous formats.
§Errors
Returns Error::InvalidInput if:
- Payload is too short for any valid audio format
- Format is unsupported or unrecognized
- Byte stream is malformed (detected via Symphonia probe)
Sourcepub fn detect_with_metadata(data: &[u8]) -> Result<AudioMetadata>
pub fn detect_with_metadata(data: &[u8]) -> Result<AudioMetadata>
Detect format and extract full metadata using Symphonia probe.
This method provides comprehensive metadata extraction but is slower (~10ms). Use when full audio properties are needed (channels, sample rate, duration).
§Errors
Returns Error::InvalidInput if format cannot be determined.
Trait Implementations§
Source§impl Clone for FormatDetector
impl Clone for FormatDetector
Source§fn clone(&self) -> FormatDetector
fn clone(&self) -> FormatDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormatDetector
impl Debug for FormatDetector
Source§impl Default for FormatDetector
impl Default for FormatDetector
Source§fn default() -> FormatDetector
fn default() -> FormatDetector
Returns the “default value” for a type. Read more
impl Copy for FormatDetector
Auto Trait Implementations§
impl Freeze for FormatDetector
impl RefUnwindSafe for FormatDetector
impl Send for FormatDetector
impl Sync for FormatDetector
impl Unpin for FormatDetector
impl UnsafeUnpin for FormatDetector
impl UnwindSafe for FormatDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more