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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aware-2.0.0.tar.gz | 23.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aware-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.9 kB
Release files / aware-2.0.0.tar.gz
| Download URL | aware-2.0.0.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a64118d3181d6282b04770f3107f135342ebf149c379765360794f163a7e206
|
|
BLAKE2b-256 checksum How to use checksums |
d6822c1e37d4d4c8db38a83d90216852ad1b3074c2b3b35c0f638cb775e95102
|
| 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 logRelease files / aware-2.0.0-py3-none-any.whl
| Download URL | aware-2.0.0-py3-none-any.whl |
|---|---|
| Size | 31.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
374f3b43306dbdd2210fc75415261c982d47eb632275497072d971e91548ee64
|
|
BLAKE2b-256 checksum How to use checksums |
c8ec3a33b9de835c925e88d2da839567eca96139dd35e9f99285c8d3d05a5466
|
| 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