metadata_audio library

Audio metadata parser library for Dart.

Classes

AiffLoader
Apev2Loader
AsfLoader
AudioMetadata
Complete audio metadata including format, native tags, and common tags
AudioTrack
Audio track information
BytesTokenizer
Tokenizer implementation for in-memory byte data
Chapter
Chapter information
Comment
Comment information
CommonTags
Common tags (standardized metadata)
DsdiffLoader
DsfLoader
FileInfo
Information about the audio file being parsed
FileTokenizer
Tokenizer implementation for file-based audio data using dart:io
FlacLoader
Format
Format information about the audio
HttpBasedTokenizer
Abstract base class for HTTP-based tokenizers.
HttpTokenizer
Tokenizer that downloads the entire file before parsing.
Id3v2Loader
LyricsTag
Synchronized lyrics tag
LyricsText
Lyrics text with optional timestamp
MatroskaLoader
MatroskaParser
MatroskaTagMapper
MetadataEvent
Event representing a metadata change during parsing
Mp4Loader
MpegLoader
MusepackLoader
OggLoader
ParseOptions
Options for parsing audio metadata
ParserFactory
Factory for selecting and retrieving appropriate parser loaders.
ParserLoader
Contract for lazily loading and invoking an audio metadata parser.
ParserRegistry
Registry that maintains a map of parser loaders by extension and MIME type.
ParserWarning
Parser warning information
Picture
Picture/cover art information
ProbingRangeTokenizer
Tokenizer that probes multiple locations in the file for scattered metadata.
QualityInformation
Quality information with parser warnings
RandomAccessTokenizer
Tokenizer that provides true random access via on-demand Range requests.
RangeTokenizer
Tokenizer that downloads only a header chunk using Range requests.
Rating
Rating information
Ratio
Ratio with dB value
StrategyInfo
Result of strategy detection.
Tag
Tag representation with id and value
Tokenizer
Abstract base class for tokenizers that read and parse binary audio data
TrackInfo
Track information
TrackNo
TrackNo with number and total
Url
URL reference
VideoTrack
Video track information
WaveLoader
WavPackLoader

Enums

ParseStrategy
Strategy for URL parsing.
ProbeStrategy
Probing strategy for fetching scattered metadata across the file.

Constants

matroskaDtd → const EbmlElementType
Matroska/WebM EBML document type definition.

Functions

createDefaultParserFactory() ParserFactory
Create a default ParserFactory with all format loaders registered.
detectStrategy(String url, {Duration? timeout, int largeFileThreshold = 5 * 1024 * 1024}) Future<StrategyInfo>
Detect the best parsing strategy for a URL.
initializeParserFactory(ParserFactory factory) → void
Initialize the parser factory for public API entrypoints.
orderTags(List<Tag> tags) Map<String, List>
Group tags by ID in a map.
parseBytes(Uint8List bytes, {FileInfo? fileInfo, ParseOptions? options}) Future<AudioMetadata>
Parse audio metadata from a byte array.
parseFile(String path, {ParseOptions? options}) Future<AudioMetadata>
Parse audio metadata from a file path.
parseFromTokenizer(Tokenizer tokenizer, {ParseOptions? options}) Future<AudioMetadata>
Parse audio metadata from a tokenizer.
parseStream(Stream<List<int>> stream, {FileInfo? fileInfo, ParseOptions? options}) Future<AudioMetadata>
Parse audio metadata from a stream of bytes.
parseUrl(String url, {ParseOptions? options, Duration? timeout, ParseStrategy? strategy, ProbeStrategy probeStrategy = ProbeStrategy.scatter, void onStrategySelected(ParseStrategy strategy, String reason)?}) Future<AudioMetadata>
Smart URL parser that automatically selects the best strategy.
ratingToStars(double? normalizedRating) int?
Convert normalized rating (0-1) to star rating (1-5).
scanPostHeaders(Tokenizer tokenizer, ParseOptions options) Future<void>
Scans for appending headers at the end of the audio file
selectCover(List<Picture>? pictures) Picture?
Select the best cover art from a list of pictures.

Typedefs

MetadataObserver = void Function(MetadataEvent event)
Metadata event observer callback type
NativeTags = Map<String, List<Tag>>
Map of native tags by type

Exceptions / Errors

CouldNotDetermineFileTypeError
Error thrown when the file type cannot be determined.
FieldDecodingError
Error thrown when a specific field cannot be decoded.
FileDownloadError
Error thrown when downloading a file from URL fails.
InternalParserError
Error thrown for internal parser bugs.
MatroskaContentError
ParseError
Base exception class for all parsing errors.
TokenizerException
Exception thrown when attempting an unsupported operation on a tokenizer
UnexpectedFileContentError
Error thrown when file content does not match the expected format.
UnsupportedFileTypeError
Error thrown when the detected file type is not supported.