Skip to content

NoiseProbe

Samples the noise level from the microphone and reports it as Noise data.

Used for the MediaSamplingPackage.NOISE measure. Does not record sound. It listens for the duration of each sampling window and reports the mean, standard deviation, min and max decibel of that window. Configure the interval and window duration with a PeriodicSamplingConfiguration.

No measurement is added if no finite readings were collected in a window.

Inheritance

Constructors

NoiseProbe

NoiseProbe()

Properties

bufferingStream

Stream<NoiseReading> get bufferingStream
override

The stream of events to be buffered. Must be specified by sub-classes.

Methods

getMeasurement

Future<Measurement?> getMeasurement()
override

Subclasses should implement / override this method to collect the Measurement. This method will be called every time data has been buffered for a duration and should return the final measurement for the buffered data.

Can return null if no data is available. Can return an Error if an error occurs.

onSamplingData

void onSamplingData(
  1. dynamic event
)
override

Handler for handling onData events from the buffering stream.

onSamplingEnd

void onSamplingEnd()
override

Handler called when sampling period ends.

onSamplingStart

void onSamplingStart()
override

Handler called when sampling period starts.