CSNoiseSensor Class Reference

Inherits from CSSensor : NSObject
Conforms to AVAudioRecorderDelegate
Declared in CSNoiseSensor.h

Overview

Sensor that stores noise data collected from the phone’s microphone. It does not store the actual audio but processes it an amount of decibel to describe the amount of ambient noise. Note that right now this sensor does its own data collection.

Ambience settings

  • kCSAmbienceSettingInterval
    Interval between sampling ambience (currently only noise) data. Specified in seconds, by default set to 60 seconds.
  • kCSAmbienceSettingSampleOnlyWhenScreenLocked
    Enabling or disabling sampling when the screen is on. When the screen is on and mircrophone is being sampled iOS shows a red bar at the top of the screen. This might scare users. A solution could be to only sample ambience (noise) data when the screen is turned off. When this setting is turned on, that is what will happen. Note that when the screen gets turned on at the moment the sampling has already started the sampling will be finished (and hence there is a small chance the red bar will be seen by the user). Disabled by default.

JSON output value format

"value": FLOAT;

– settingChanged:

- (void)settingChanged:(NSNotification *)notification