Skip to main content

AWARE: Audio Watermarking via Adversarial Resistance to Edits

Installation

pip install aware

AWARE runs on Python 3.9 to 3.12. webrtcvad (and, on Python 3.12, matplotlib) is built from source during the install, so a C compiler and the Python headers are needed (sudo apt-get install build-essential python3-dev on Debian/Ubuntu).

For development, install from a clone in editable mode:

git clone https://github.com/deepmark/aware.git
cd ./aware
python -m pip install -e .

Basic Usage

import numpy as np
import librosa
import soundfile
from aware.utils.models import load
from aware.service import embed_watermark, detect_watermark
from aware.metrics.audio import BER, PESQ

# 1. load model
# `name` selects the configuration profile:
#   - "AWARE" (default): embedding is computed over the full sequence
#   - "AWARE(20bps)": embedding is computed per second of audio
embedder, detector = load(name="AWARE")

# 2.create 20-bit watermark
watermark_bits = np.random.randint(0, 2, size=20, dtype=np.int32)


# 3.read host audio
# AWARE works at 16 kHz; librosa resamples the file on load:
signal, sample_rate = librosa.load("example.wav", sr=16000, mono=True)


# 4.embed watermark
watermarked_signal = embed_watermark(signal, 16000, watermark_bits, embedder)
# you can save it as a new one:
# soundfile.write("output.wav", watermarked_signal, 16000)


# 5. detect watermark
# Detect the watermark from the audio. The function returns:
#   - detected_pattern: the recovered watermark bits
#   - confidence: a value in [0, 1] representing the estimated probability;
#                 that the signal contains a watermark.
# If confidence >= tau (default tau = 0.5), the signal is considered watermarked;
# otherwise, it is treated as unwatermarked.
detected_pattern, confidence = detect_watermark(watermarked_signal, 16000, detector)


# 6.check accuracy and perceptual quality
ber_metric = BER()
ber = ber_metric(watermark_bits, detected_pattern)
print(f"BER: {ber:.2f}")

pesq_metric = PESQ()
pesq = pesq_metric(watermarked_signal, signal, 16000)
print(f"PESQ: {pesq:.2f}")

License

This project is licensed under the terms of the MIT license.

Citation

If you find this repository useful, we’d greatly appreciate it if you could give it a star ⭐.

Please cite our work if you use it in your research.

@article{pavlović2025aware,
      title={AWARE: Audio Watermarking with Adversarial Resistance to Edits}, 
      author={Kosta Pavlović and Lazar Stanarević and Petar Nedić and Slavko Kovačević and Igor Djurović},
      year={2025},
      eprint={2510.17512},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2510.17512}, 
}

Metadata

Release files for aware 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aware 2.0.1
File Size Uploaded
aware-2.0.1.tar.gz 23.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aware 2.0.1
File Interpreter ABI Platform
aware-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 55.0 kB

Release files / aware-2.0.1.tar.gz

Download URL aware-2.0.1.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ec23269abbb588d6111fcdd061b126b3c819c40fad391e5e1aede66151241d81
BLAKE2b-256 checksum
How to use checksums
77f709d8d01c56ef7a5f4eb93c1cda1ab0d1294df424f07b347b04f8cffa69be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / aware-2.0.1-py3-none-any.whl

Download URL aware-2.0.1-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0487e384cec6446d440284f87458cf349f65994f358070b3f7f4f8a5a3196688
BLAKE2b-256 checksum
How to use checksums
b2913ba5259847ea16a0822ca50fff2ec10d9c24f296960d43bc2b84fd4250ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page