IAudioWatermarker<T>

Interfaces · AiDotNet.Safety.Watermarking

Interface for keyed audio watermarkers that embed an inaudible watermark in audio and detect it later.

Implements: IAudioSafetyModule<T>

Known implementations: AudioWatermarkerBase<T>

For Beginners

An audio watermarker adds an inaudible, password-protected signature to audio your system produces, so the same watermarker can later tell whether a recording carries it.

How It Works

A watermarker derives a pseudo-random pattern from its secret key, adds it to a spectral transform of the audio at a level that follows the audio’s own loudness, and detects it by correlating the same transform against the same pattern. Only a watermarker constructed with the same key detects the mark; the mark survives added noise, gain changes and re-quantization to 16 bits.

References:

  • Kirovski and Malvar, Spread-Spectrum Watermarking of Audio Signals (IEEE TSP, 2003)
  • Only 38% of AI generators implement adequate watermarking (2025, arxiv:2503.18156)

Methods

Method Summary
Vector<T> EmbedWatermark(Vector<T> audioSamples, int sampleRate) Returns a copy of audioSamples carrying this watermarker’s keyed watermark.
WatermarkResult Detect(Vector<T> audioSamples, int sampleRate) Detects the watermark and reports the test behind the confidence.
double DetectWatermark(Vector<T> audioSamples, int sampleRate) Detects the watermark confidence score in the given audio (0.0 = no watermark, 1.0 = certain).