Getting Started Cameras & Video Detection & Recording Automation & Events Actions Integration & Connectivity Network & Discovery AI & Remote Control MQTT Modbus ZeroMQ System & Administration Use Cases Troubleshooting About & Legal
Home / Documentation / Sound Detection
Knowledge base

Sound Detection

Sound Detection analyzes audio frames with an FFT spectrogram and emits a SoundEvent when configured threshold rules are crossed. Use it to turn knocks, alarms, glass breaks, shouts, machine noise, or other audio spikes into Banalytics automation signals.

Audio events for automation

The task compares the current audio spectrum with a learned or fixed threshold model. When the configured condition is satisfied, it fires a SoundEvent. If the task is placed before Motion Recording or Motion Image Shot, an accepted sound event can also set AUDIO_MOTION_DETECTED and start recording or snapshot capture even when video motion is absent.

Security sounds
Trigger on knocks, shouts, alarms, glass break, door impact, or other short audio spikes.
Machine anomalies
Detect abnormal spectral changes from motors, pumps, fans, compressors, or other equipment.
Audio recording triggers
Start event video or image capture from sound when the camera view has no visible motion.
Debug tuning
Use debug events temporarily to inspect FFT magnitudes and moving averages before production use.

Audio input requirements

01

Audio frames are available

The upstream grabber, camera, playback source, or audio input component must provide audio frames. Keep audio enabled in the media source when sound-based events are required.

02

Start with debug tuning

Enable Debug only while selecting thresholds. Debug emits extra event data with FFT magnitudes and moving averages, which is helpful for tuning but noisy in production.

03

Connect downstream actions

Use Event Manager, Motion Recording, Motion Image Shot, Telegram, email, or custom actions to react to accepted sound events.

Adding the sound detection task

01

Choose the audio source

Use a camera stream with audio, an Audio Input component, or a playback source that includes audio data.

02

Add Sound Detection

Add the task under the source or capture task that delivers audio frames.

03

Select the threshold model

Start with Relative for most environments. Switch to Absolute or Proportional only when the sound source behavior requires it.

04

Tune threshold and history

Raise the threshold to reduce false events, lower it if real sounds are missed, and adjust spectrum and history settings to match the noise profile.

Configuration parameters

These are the parameters available when configuring Sound Detection.

ParameterRequiredDescriptionDefault
ID
YesUnique identifier generated automatically for this task instance. Read-only.Auto
Restart on failure
YesControls how the task is restarted after an error: stop on failure, immediately, 10 sec, 30 sec, or 1 min.10 sec
Debug
YesEmits diagnostic sound data with current FFT magnitudes and moving averages. Enable only while tuning because it can create a high event volume.false
Threshold type
OptionalThreshold calculation mode: Relative, Absolute, or Proportional.Relative
Threshold
OptionalDetection threshold value. Increase to reduce false events from wind, hum, traffic, rain, or microphone noise. Decrease when real sounds are missed.10
Spectral sensitivity
OptionalNumber of frequency ranges analyzed. Valid range is 10 to 100. Higher values provide more detail but cost more CPU and can be more sensitive to tuning mistakes.40
History length
YesLength of the background analysis buffer. Valid range is 1 to 20. Longer history is more stable but adapts more slowly.10
Apply upon threshold exceed
YesWhen enabled, threshold-exceeding sounds can be learned into the background model. Use it for recurring or slowly changing loud noise that should not trigger continuously.false
Speed of accustom (sec)
ConditionalBackground adaptation speed when Apply upon threshold exceed is enabled. Lower values adapt faster; higher values preserve sensitivity longer.1

Choosing the right threshold model

01

Relative

Best starting point for rooms, offices, streets, and camera microphones with changing ambient noise. It compares current spectrum values with the learned background average.

02

Absolute

Use when microphone gain and background level are stable and you want a fixed trigger level. It is simple but can be too sensitive in noise or too insensitive in quiet, low-gain recordings.

03

Proportional

Use when relative growth matters more than absolute amplitude, for example a quiet room where a sound several times louder than baseline should trigger. Tune carefully when baseline values are very low.

Recommended profiles

01

General audio motion

Threshold type = Relative, Threshold = 10, Spectral sensitivity = 40, History length = 10, Apply upon threshold exceed = false.

02

Quiet room or sensitive alarm

Use Relative or Proportional, lower the threshold, set Spectral sensitivity to 40-80, and keep Apply upon threshold exceed disabled so short abnormal sounds remain abnormal.

03

Noisy outdoor camera

Use Relative, a higher threshold, Spectral sensitivity = 20-40, History length = 15-20, and enable adaptation with Speed of accustom = 5-20.

04

Stable microphone with known levels

Use Absolute and tune the threshold from debug magnitudes. Keep spectral sensitivity moderate and history shorter when the environment is predictable.

05

Machinery or repeating background noise

Use Relative, higher spectral sensitivity, a stable history length, and threshold-exceed adaptation so normal cycles are learned while short anomalies still trigger.

Load and quality tradeoff: Higher spectral sensitivity can catch narrow-band sounds but increases work and makes tuning more sensitive. Longer history reduces random false positives but reacts more slowly to real changes in ambient sound.