AudioProbe class final

What a file's bytes say it is.

Produced by sniffBytes, sniffStream, sniffReader and the file helpers. A probe never throws: input it cannot understand produces AudioFormat.unknown.

Constructors

AudioProbe({required AudioFormat format, Duration? duration, DurationAccuracy? durationAccuracy, int? sampleRate, int? channels, int? bitsPerSample, String? codec, int? audioOffset, Set<ProbeNote> notes = const {}})
Creates a probe result. Normally produced by the sniffing functions.
const

Properties

audioOffset → int?
Byte offset where the audio payload starts, when known.
final
bitsPerSample → int?
Bits per sample, when meaningful for the codec.
final
channels → int?
Channel count, when the header states it.
final
codec → String?
A short codec name: flac or mp3; for WAV, pcm, float, alaw, mulaw, adpcm-ms, adpcm-ima, mpeg or mp3, and any other format tag in hex (such as 0x0161); for AIFF, pcm or the AIFF-C compression type (such as sowt); for M4A, the sample entry type (such as mp4a or alac).
final
duration → Duration?
Playing time read from the header, or null when the header cannot say for certain. Never a guess dressed up as a fact: see durationAccuracy.
final
durationAccuracy → DurationAccuracy?
How duration was obtained; null exactly when duration is null.
final
format → AudioFormat
The container the bytes are.
final
hashCode → int
The hash code for this object.
no setterinherited
isDurationExact → bool
Whether duration is an exact header value.
no setter
isKnown → bool
Whether the bytes matched a supported format.
no setter
notes → Set<ProbeNote>
Facts about how the file was read.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampleRate → int?
Samples per second, when the header states it.
final

Methods

extensionLies(String nameOrPath) → bool
True when nameOrPath carries an extension and that extension disagrees with the bytes: a WAV named .mp3.
extensionMatches(String nameOrPath) → bool
True when nameOrPath ends in an extension that leads a player to the right demuxer for these bytes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

unknown → const AudioProbe
The result for bytes that match no supported format.