AudioDevice class abstract

A base class for audio devices.

You can instantiate a PlaybackDevice or CaptureDevice using the AudioDeviceContext.

Mixed-in types
Implementers

Constructors

AudioDevice.new({required AudioDeviceContext context, required CaDevice device})
Initialize the device.

Properties

availableReadFrames int
Available buffered frame count of the device. This value can be changed when isStarted flag is true.
no setter
availableWriteFrames int
Available writable frame count of the device. This value can be changed when isStarted flag is true.
no setter
bufferFrameSize int
The device's internal buffer frame size.
latefinal
context AudioDeviceContext
Current device context for this instance.
final
deviceInfo AudioDeviceInfo?
Get the current device information. You can listen the notificationStream to detect device changes. When no device is specified while constructing the instance, this method returns null.
no setter
format AudioFormat
The device's format. If the device supports format natively, no conversion will occurs. Otherwise, miniaudio will try to convert the format.
latefinal
hashCode int
The hash code for this object.
no setterinherited
isDisposed bool
Whether this resource is already disposed.
no setterinherited
isStarted bool
A flag indicates the device is started or not.
no setter
notification Stream<AudioDeviceNotification>
The device's notification stream. Use this stream to detecting route and lifecycle changes.
latefinal
resourceId int
The unique identifier of this resource.
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state AudioDeviceState
The current state of the device.
no setter
type AudioDeviceType
The device's type.
latefinal
volume double
The current volume of the device.
getter/setter pair

Methods

clearBuffer() → void
Clear the internal buffer.
clearResourceFinalizer() → void
Clears the finalizer for this resource.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setResourceFinalizer<T>(void onFinalize()) → void
Sets a finalizer for this resource.
inherited
start() → void
Start the audio device.
stop({bool clearBuffer = true}) → void
Stop the audio device. When clearBuffer is set to true, internal buffer will be cleared automatically (true by default).
throwIfDisposed() → void
Throws an AudioResourceDisposedException if this resource is already disposed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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