MediaSamplingPackage
The sampling package for capturing audio (incl. noise) and video (incl. images).
Register it before you deploy a protocol that uses its measure types:
SamplingPackageRegistry().register(MediaSamplingPackage());
Key points:
- AUDIO and NOISE use the microphone and request the microphone permission.
- VIDEO and IMAGE do not collect anything themselves. The app records the media and must request the camera permission itself (see VideoProbe).
- Media files are stored in the MEDIA_FILES_PATH folder of the deployment's data folder.
See also AudioProbe and NoiseProbe.
- Inheritance
-
- Object
- SamplingPackage
- SmartphoneSamplingPackage
- MediaSamplingPackage
Constructors
MediaSamplingPackage
Constants
AUDIO
Measure type for one-time collection of audio from the phone's microphone.
- One-time measure.
- Uses the Smartphone primary device for data collection.
- No sampling configuration needed.
- Collected as AudioMedia data.
IMAGE
Measure type for an image captured by the app (ImageMedia).
- One-time measure.
- Uses the Smartphone primary device.
- The app creates the measurement; VideoProbe only acts as a placeholder.
MEDIA_FILES_PATH
The name of the folder used for storing media files.
NOISE
Measure type for periodic collection of noise data from the phone's microphone.
- Event-based (Periodic) measure.
- Uses the Smartphone primary device for data collection.
- Use a PeriodicSamplingConfiguration for configuration. Default is 10 seconds every 5 minutes.
- Collected as Noise data.
VIDEO
Measure type for a video recorded by the app (VideoMedia).
- One-time measure.
- Uses the Smartphone primary device.
- The app creates the measurement; VideoProbe only acts as a placeholder.
Properties
samplingSchemes
The default sampling schemes for all dataTypes in this package.
All sampling packages should defined a DataTypeSamplingScheme for each data type.
Methods
create
Creates a new Probe of the specified type. Note that type should be one of the dataTypes that this package supports. Returns null if a probe cannot be created for the type.
onRegister
Callback method when this package is being registered.