RecordPlatform class abstract

The interface that implementations of Record must implement.

Platform implementations should extend this class rather than implement it as record does not consider newly added methods to be breaking changes. Extending this class ensures that the subclass will get the default implementation, while platform implementations that merely implement the interface will be broken by newly added RecordPlatform functions.

Inheritance
  • Object
  • PlatformInterface
  • RecordPlatform

Constructors

RecordPlatform()
Constructs a RecordPlatform.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel(String recorderId) Future<void>
Stops the recording if needed and remove current file.
create(String recorderId) Future<void>
Create a recorder
dispose(String recorderId) Future<void>
Dispose the recorder
getAmplitude(String recorderId) Future<Amplitude>
Gets current average & max amplitudes (dBFS) Always returns zeros on unsupported platforms
hasPermission(String recorderId) Future<bool>
Checks and requests for audio record permission.
isEncoderSupported(String recorderId, AudioEncoder encoder) Future<bool>
Checks if the given encoder is supported on the current platform.
isPaused(String recorderId) Future<bool>
Checks if recording session is paused.
isRecording(String recorderId) Future<bool>
Checks if there's valid recording session. So if session is paused, this method will still return true.
listInputDevices(String recorderId) Future<List<InputDevice>>
Lists capture/input devices available on the platform.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onStateChanged(String recorderId) Stream<RecordState>
Listen to recorder states RecordState.
pause(String recorderId) Future<void>
Pauses recording session.
resume(String recorderId) Future<void>
Resumes recording session after pause.
start(String recorderId, RecordConfig config, {required String path}) Future<void>
Starts new recording session.
startStream(String recorderId, RecordConfig config) Future<Stream<Uint8List>>
Same as start with output stream instead of a path.
stop(String recorderId) Future<String?>
Stops recording session and release internal recorder resource.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance RecordPlatform
The default instance of RecordPlatform to use.
getter/setter pair