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:
flacormp3; for WAV,pcm,float,alaw,mulaw,adpcm-ms,adpcm-ima,mpegormp3, and any other format tag in hex (such as0x0161); for AIFF,pcmor the AIFF-C compression type (such assowt); for M4A, the sample entry type (such asmp4aoralac).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
nameOrPathcarries an extension and that extension disagrees with the bytes: a WAV named.mp3. -
extensionMatches(
String nameOrPath) → bool -
True when
nameOrPathends 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.