Skip to content

AudioProbe

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

Constructors

AudioProbe

AudioProbe()

Properties

isRecording

bool get isRecording

Whether a recording is in progress.

Methods

onDispose

Future<void> onDispose()
override

Callback when this executor is disposed.

Subclasses should override this, to implement any cleanup to be done before disposing.

onInitialize

bool onInitialize()
override

Callback when this executor is initialized. Returns true if successfully initialized, false otherwise.

Note that this is a non-async method and should hence be 'light-weight' and not block execution for a long duration.

onPause

Future<bool> onPause()
override

Callback when this executor is paused. Returns true if successfully paused, false otherwise.

onResume

Future<bool> onResume()
override

Callback when this executor is resumed. Returns true if successfully resumed, false otherwise.