# Advanced configurations (https://docs.cochl.ai/docs/core/advanced-configurations)



You can customize your detection results by modifying the advanced configurations in &#x2A;*config.json.**

## 1. Sensitivity control [#1-sensitivity-control]

**Sensitivity Control** allows users to adjust the sensitivity so that it can be customized depending on target sounds and user scenarios. Sensitivity is one of `"VERY_LOW"`, `"LOW"`, `"NORMAL"`, `"HIGH"`, or `"VERY_HIGH"`. The default is `"NORMAL"`. Sensitivity can be set **globally** or &#x2A;*individually per tag.**

* If certain tags are not detected often enough, try increasing the sensitivity.
* If you experience too many false detections, lowering the sensitivity may help.

<img src="/images/core/advanced-configurations/sensitivity_control.png" alt="The five sensitivity values from VERY_LOW to VERY_HIGH, with NORMAL as the default. Lower sensitivity raises the detection threshold for fewer false detections; higher sensitivity lowers it so tags are detected more often." />

```json
"sensitivity_control": {
  "default_sensitivity": "LOW",
  "tag_sensitivity": {
    "Baby_cry": "VERY_LOW",
    "Gunshot": "HIGH"
  }
}
```

The configuration above sets the default sensitivity to `LOW`, but overrides `"Baby_cry"` to `VERY_LOW` and `"Gunshot"` to `HIGH`. Values are case-insensitive. Numeric values from older versions are ignored: a numeric `default_sensitivity` falls back to `NORMAL`, and a numeric per-tag entry is dropped so that tag uses `default_sensitivity`.

## 2. Result summary [#2-result-summary]

**Result Summary** summarizes the prediction results by merging consecutive detection windows and returns the start time and duration of each detected sound tag.

The **interval\_margin** parameter defines how long a gap between adjacent detections should still be considered part of a single event. This margin is applied globally to all tags by default, but it can also be overridden per tag to fine-tune behavior individually.

**NOTE**: In stream mode, only `default_interval_margin` is applied; per-tag `tag_interval_margin` entries are ignored. The default margin can also be changed at runtime (`SetResultSummaryMargin` / `result_summary_margin` / `setResultSummaryMargin`). In stream mode, a window that produces no interval line emits `"Listening..."` instead, so `summaries` is never empty while the feature is on; file mode emits nothing for such a window.

<img src="/images/core/advanced-configurations/result_summary.png" alt="Timeline with an interval margin of 2 seconds: Baby_cry detections at 0–3 s and 4–6 s are 1 s apart and merge into one event from 0 to 6 s; a detection at 10–12 s, 4 s later, becomes a separate event." />

```json
"result_summary": {
  "enable": true,
  "default_interval_margin": 2,
  "tag_interval_margin": {
    "Baby_cry": 5,
    "Gunshot": 3
  }
}
```

The configuration above sets the global interval margin to `2` seconds, but overrides the margin for `"Baby_cry"` to `5` seconds and for `"Gunshot"` to `3` seconds.

## 3. Audio activity detection (stream only) [#3-audio-activity-detection-stream-only]

**Audio Activity Detection** analyzes incoming microphone audio and selects only high-activity segments, automatically ignoring low-volume sounds.

By skipping inference during periods of minimal audio activity, this feature helps reduce hardware usage and improve overall efficiency. It also lowers the risk of false positives caused by ambiguous or quiet background sounds.

When enabled, users can fine-tune the **Sensitivity** parameter to control how much audio activity is selected. Higher sensitivity allows quieter sounds to be selected and passed to inference, while lower sensitivity filters out more low-activity sounds. Sensitivity is one of `"VERY_LOW"`, `"LOW"`, `"NORMAL"`, `"HIGH"`, or `"VERY_HIGH"`. The default is `"NORMAL"`.

**NOTE**: It is recommended to **disable** this feature in the following situations:

* “When the target sound must be detected even if it is very quiet”
* “When the environment is not quiet, and the target sound is often masked by other noises”

<img src="/images/core/advanced-configurations/audio_activity_detection.png" alt="Audio level over time: passages above the selection level go to inference and quieter passages are skipped. Higher sensitivity lowers the selection level." />

```json
"audio_preprocessor": {
  "audio_activity_detection": {
    "enable": true,
    "history_count": 600,
    "sensitivity": "NORMAL"
  }
}
```

The configuration above sets the selection sensitivity to `NORMAL`. The `"history_count"` parameter defines the duration (in seconds) of recent volume data to consider for adaptive response.

## 4. Automatic gain control (stream only) [#4-automatic-gain-control-stream-only]

**Automatic Gain Control (AGC)** analyzes incoming audio streams in real time and automatically amplifies signals that are too quiet.

Microphone gain can vary across devices, which may result in audio inputs that are too low in volume. This can cause a mismatch between expected and actual recognition performance. AGC helps address this issue by boosting quiet signals.

<img src="/images/core/advanced-configurations/automatic_gain_control.png" alt="A quiet microphone signal passes through AGC and comes out amplified." />

```json
"audio_preprocessor": {
  "automatic_gain_control": {
    "enable": true
  }
}
```
