AudioProbe class

Records audio from the microphone to a file.

Used for the MediaSamplingPackage.AUDIO measure. Recording starts on onResume and stops on onPause. On stop, the probe adds an AudioMedia measurement to the measurements stream.

Key points:

  • Only one recording can run at a time.
  • Records raw sound, including any human speech nearby, and produces a lot of data. Use with caution.
  • The sound file is stored as AAC in an .mp4 file in the MediaSamplingPackage.MEDIA_FILES_PATH folder, named by the MediaData.id.
  • The AudioMedia data holds the metadata and file name. How the file is uploaded is up to the DataManager used in the deployment.
Inheritance
  • Object
  • AbstractExecutor<Measure>
  • Probe
  • AudioProbe

Constructors

AudioProbe()

Properties

configuration → Measure?
The configuration of this executor as set in initialize.
no setterinherited
deployment → SmartphoneDeployment?
The deployment that this executor is part of executing.
no setterinherited
deviceManager ↔ DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration>
The device manager of the device this probe collects data from.
getter/setter pairinherited
enabled ↔ bool
Whether this probe is enabled.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
isRecording → bool
Whether a recording is in progress.
no setter
measure → Measure?
The Measure that configures this probe.
no setterinherited
measurements → Stream<Measurement>
The stream of Measurement collected by this executor.
no setterinherited
permissions → List<Permission>
The permissions this probe needs. Empty if none.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
samplingConfiguration → SamplingConfiguration?
The sampling configuration for this probe.
no setterinherited
samplingState → SamplingState
The runtime sampling state of this executor.
no setterinherited
state → ExecutorState
The runtime state of this executor.
no setterinherited
stateEvents → Stream<ExecutorState>
The runtime state changes of this executor.
no setterinherited
type → String?
The data type this probe collects, e.g. dk.cachet.carp.steps.
no setterinherited

Methods

addError(Object error, [StackTrace? stacktrace]) → void
Logs error as a warning and adds it to the measurements stream.
inherited
addMeasurement(Measurement measurement) → void
Adds measurement to measurements.
inherited
arePermissionsGranted() → Future<bool>
Whether all permissions are granted. Returns false if checking fails.
inherited
dispose() → void
Disposes this executor.
inherited
error() → void
Moves this executor to ExecutorState.Undefined.
inherited
hasRequiredPermissions() → Future<bool>
Whether this probe is allowed to run.
inherited
initialize(Measure configuration, [SmartphoneDeployment? deployment]) → void
Configures and initializes the executor. Call before resume.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose() → Future<void>
Callback when this executor is disposed.
override
onInitialize() → bool
Called by initialize. Returns true if successfully initialized.
override
onPause() → Future<bool>
Called by pause. Returns true if successfully paused.
override
onResume() → Future<bool>
Called by resume. Returns true if successfully resumed.
override
pause() → void
Pauses the executor until resume is called.
inherited
pauseButShouldBeResumed() → void
Pauses the executor and marks it to be resumed later.
inherited
requestPermissions() → Future<bool>
Asks the user for any permissions not yet granted.
inherited
resume() → void
Starts or resumes the executor.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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