AudioParams class final Output

Audio format parameters reported by mpv. Used both for the decoder side (audio-params + audio-codec*) and for the hardware output side (audio-out-params).

Constructors

AudioParams({Format? format, int? sampleRate, Channels? channels, int? channelCount, String? hrChannels, String? codec, String? codecName})
Creates an audio-format descriptor. Every field is nullable because mpv reports them only while audio is being decoded or output.
const

Properties

channelCount → int?
Number of audio channels.
final
channels → Channels?
Channel layout reported by mpv. null when no audio is currently being decoded. Unknown layouts fall back to Channels.custom via Channels.fromMpv.
final
codec → String?
Raw value of mpv's audio-codec property. The exact form (short id vs descriptive name) varies by mpv build and codec (mp3 vs mp3float, aac vs aac_lc, FLAC vs FLAC (Free Lossless Audio Codec)); treat as an opaque hint. For reliable codec-family matching, do a case-insensitive substring check against BOTH codec and codecName.
final
codecName → String?
Raw value of mpv's audio-codec-name property. Same volatility caveat as codec: the split between short and descriptive is not stable across mpv versions, and one of the two may be absent on a given file.
final
format → Format?
Sample format reported by mpv. null when no audio is currently being decoded. mpv occasionally emits a format string the wrapper doesn't recognise (e.g. a future-version sample type); those fall back to Format.auto via Format.fromMpv.
final
hashCode → int
The hash code for this object.
no setteroverride
hrChannels → String?
Human-readable channel layout description.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampleRate → int?
Sample rate in Hz.
final

Methods

copyWith({Object? format = unset, Object? sampleRate = unset, Object? channels = unset, Object? channelCount = unset, Object? hrChannels = unset, Object? codec = unset, Object? codecName = unset}) → AudioParams
Returns a copy with the given fields replaced. Pass null explicitly to clear a field; omitted fields keep their current value.
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.
override