JorenSix/Olaf
Olaf: Overly Lightweight Acoustic Fingerprinting is a portable acoustic fingerprinting system.
What it solves
OLAF identifies audio content by extracting fingerprints from an audio stream and matching them against a stored database. It solves the problem of searching audio by content rather than metadata, and it is specifically designed to work on severely constrained embedded platforms like ESP32, while also being fast on traditional computers and usable in web browsers. Note: some algorithms are covered by US patents, so check licensing before production use.
How it works
OLAF extracts perceptual fingerprints from audio, then either stores them in a database or matches a query against stored fingerprints. On desktop systems, fingerprints are kept in LMDB, a high-performance key-value store with B+-tree persistence. On embedded platforms and in the browser, the fingerprint index is a static list of hashes in a header file (in-memory). Audio input is decoded and resampled using FFmpeg. The core is written in portable C; Zig is used as a cross-compiler and can build a WebAssembly module (~75 KB) that runs inside an AudioWorklet in the browser. The command-line interface supports storing, querying, deleting, deduplication, and live microphone matching.
Who it's for
Developers who need audio search or fingerprinting on resource-limited hardware (e.g., microcontrollers), in web applications, or on high-performance servers. It is also aimed at learners who want to study efficient acoustic fingerprinting algorithms, but note the patent restrictions.
Highlights
- Runs on embedded platforms such as ESP32, Arduino, and Teensy with limited memory and CPU.
- Fast on traditional computers thanks to efficient C code and LMDB storage.
- Compiles to WebAssembly for in-browser audio fingerprinting, integrating with the Web Audio API.
- Written in portable C; Zig simplifies cross-compilation to many targets including Windows and WASM.
- Provides a non-interactive command-line interface and an interactive terminal browser for demo and interaction.
- Supports multi-threading, fragmented queries, custom identifiers, and deduplication.
- Docker images are available for linux/amd64 and linux/arm64 with a distroless runtime.
Related
- Project
- Project
- Project
- Project
- Project