Aureal Watermark Documentation

Developer reference, algorithmic principles, and enterprise deployment guides for Aureal's psychoacoustic spread-spectrum watermark engine.

Overview & Architecture

Aureal Watermark is an acoustic spread-spectrum watermark engine written in pure, zero-dependency JavaScript and Node.js. It embeds an invisible, cryptographically verifiable provenance signature into master audio recordings, surviving lossy re-encoding, social media transcoding, pitch-shifting, and AI voice cloning scraper pipelines.

Air-Gapped & Supply-Chain Secure

Runs cleanly with zero external runtime packages. Immune to supply-chain vulnerabilities and auditable for studio air-gap compliance.

100% Offline Client-Side

Web Audio API implementation allows full in-browser verification and watermark extraction without sending audio bytes to any server.

Cryptographic Matching

Spread across psychoacoustic frequency bins using keyed orthogonal pseudorandom noise sequences and CRC-16 forward error correction.

CLI Quick Start

Get up and running in seconds. You can generate synthetic speech-like material for testing, embed unique tracking IDs, and verify audio files directly from the command line.

Bash / Terminal
# 1. Synthesize 30 seconds of speech-like audio (no sample file needed)
node bin/auralwatermark.js gen test.wav --seconds 30 --rate 44100

# 2. Embed a 32-bit recipient tracking ID with your secret salt
node bin/auralwatermark.js embed test.wav marked.wav --id 1234567 --key my-secret

# 3. Verify watermark with matched filter detection
node bin/auralwatermark.js detect marked.wav --id 1234567 --key my-secret
# Outputs: detected: YES / confidence: 1.000 / ber: 0.0% / band hit: high/mid

# 4. Blind Detection: Extract embedded ID without providing expected ID
node bin/auralwatermark.js detect unknown.wav --key my-secret --json

Deterministic CLI Exit Codes

Exit code 0 indicates verified watermark detection; 1 indicates not detected; 2 indicates file or format error. Ideal for automated CI/CD and mastering pipelines.

CLI Options Reference

gen <output.wav>

Generates harmonic speech-like test audio with envelope modulation to benchmark embedding and detection without external audio files.

Option Default Description
--seconds <N> 10 Audio duration in seconds.
--rate <R> 44100 Sample rate (e.g. 44100, 48000, 96000).
--channels <C> 2 Channel count (1 for mono, 2 for stereo).

embed <in.wav> <out.wav> --id <uint32>

Embeds an imperceptible watermark into an existing uncompressed PCM audio file.

Option Default Description
--id <uint32> Required 32-bit unsigned tracking identifier (0 to 4,294,967,295).
--key <string> default Secret cryptographic seed salt. Must match at detection time.
--strength <0..1> 0.5 Embedding amplitude scale. 0.5 represents strictly below HAS thresholds.
--band <preset> dual high (16.5–19.5 kHz), mid (8–13 kHz), or dual (both bands).

detect <in.wav> [--id <uint32>] [--key <s>]

Scans an audio stream for watermarks. Operates in targeted verification mode (when --id is passed) or blind extraction mode.

Option Default Description
--id <uint32> Omitted Expected ID for matched filter test. If omitted, blind extraction recovers any embedded ID.
--key <string> default Secret key corresponding to the embedder.
--band <preset> auto Auto-evaluates available bands and returns the highest confidence match.
--json false Outputs structured JSON with bit-error-rate (BER), confidence scores, and z-statistics.

Web Audio & Browser DSP

Aureal provides a browser-native verifier (src/browser/aural-watermark-verify.js) that decodes and validates audio directly inside modern web browsers using standard Web Audio APIs.

JavaScript (ESM / Browser)
import { verifyAudioBuffer } from "./src/browser/aural-watermark-verify.js";

// 1. Decode any web-supported format (MP3, AAC, FLAC, WAV, OGG)
const audioContext = new AudioContext();
const response = await fetch("streamed_audio.mp3");
const arrayBuffer = await response.arrayBuffer();
const audioBuffer = await audioContext.decodeAudioData(arrayBuffer);

// 2. Perform offline sub-second matched filter analysis
const result = verifyAudioBuffer(audioBuffer, 1234567, "my-secret-key");

if (result.detected) {
  console.log(`Watermark Validated! Confidence: ${result.confidence * 100}%`);
  console.log(`Recovered Payload ID: ${result.recoveredPayloadId}`);
} else {
  console.log("No valid watermark detected in audio stream.");
}

Privacy & Air-Gapped Advantage

Because the detection executes inside the client's Web Audio DSP thread, zero megabytes of audio are ever uploaded to cloud endpoints. This satisfies strict enterprise NDA and zero-data-retention compliance policies.

Node.js API Reference

Integrate directly into backend audio pipelines, streaming servers, and distribution platforms:

JavaScript (Node.js)
import { embedWatermark, detectWatermark } from "aureal-watermark";
import { readWavFile, writeWavFile } from "aureal-watermark/src/wav.js";

// Read master recording
const wav = await readWavFile("master.wav");
const fmt = { sampleRate: wav.sampleRate, channels: wav.channels };

// Embed tracking signature
const watermarkedPcm = embedWatermark(wav.samples, fmt, {
  payloadId: 987654,
  key: process.env.WATERMARK_SALT,
  strength: 0.5,
  band: "dual"
});

// Write tagged WAV file
await writeWavFile("preview_watermarked.wav", watermarkedPcm, { ...fmt, bitDepth: 16 });

// Verify watermark
const verification = detectWatermark(watermarkedPcm, fmt, {
  payloadId: 987654,
  key: process.env.WATERMARK_SALT,
  band: "auto"
});

console.log(verification);
// { detected: true, confidence: 1.0, ber: 0.0, zScore: 14.2, frameCount: 30 }

Human Auditory System (HAS) Masking

Conventional audio watermarking methods rely on simple metadata tags or naive ultrasonic chirps (> 20 kHz). However, consumer audio encoders (MP3, AAC, Opus) immediately filter out high frequencies and strip ID3 headers during transcoding.

Aureal solves this by embedding directly into the audible frequency spectrum, strictly constrained below the biological inaudibility envelope of human hearing:

Frequency & Temporal Masking

When a loud musical tone or transient sound occurs (such as a kick drum or vocal formant), adjacent frequency bins within the critical Bark bandwidth cannot be perceived by the human ear. Aureal modulates the watermark energy strictly beneath this dynamic psychoacoustic threshold envelope.

Direct Sequence Spread Spectrum (DSSS)

Rather than placing watermark energy in a few concentrated frequencies, Aureal uses an orthogonal pseudo-random noise sequence to spread the 32-bit payload across thousands of frequency bins:

  • The energy per frequency bin is tens of decibels lower than ambient acoustic noise.
  • Lossy audio compression algorithms (MP3, AAC, YouTube, TikTok) treat the watermark as natural harmonic texture and preserve it during encoding.
  • Only a decoder with the matching cryptographic seed key can de-spread and recover the embedded provenance payload.

Commercial Licensing & Enterprise SLAs

Aureal Watermark offers commercial production licenses and custom enterprise deployment models:

License Type Price Target Use Case Telemetry / Air-Gap
Noncommercial / Academic Free ($0) Evaluation, open-source research, non-monetized music production. 100% Offline / Zero Telemetry
Commercial Indie Label $299 / yr Independent record labels, promo distribution pools, podcast networks. Self-Hosted / Unlimited Streams
Enterprise Platform SLA Custom AI voice cloning training data audit, major streaming services, high-throughput DSP. Air-Gapped / Custom Bands / SLAs

For complete licensing terms, procurement details, and enterprise SLAs, visit the Commercial Licensing & Pricing Page →