Skip to main content

AudioQL

A semantic layer for audio.

AudioQL wraps Whisper, pyannote, YAMNet and friends behind one small API. You point it at an audio file and get a semantic timeline — a single stream of events ("speech", "laughter", "music", "silence", ...) you can query with plain English:

from audioql import Audio

audio = Audio("meeting.mp3")

audio.find("laughter")               # all the laughs
audio.find("music after applause")   # sequencing works too
audio.find("speaker:SPEAKER_00")     # one speaker's turns
audio.search("someone discussing AI")  # keyword search over the transcript

No model-specific APIs leak out. Every backend produces the same TimelineEvent, so swapping Whisper for something else doesn't change your code.

Install

The core package is small and has no AI dependencies:

pip install audioql

Model backends are optional extras — install only what you use:

pip install "audioql[whisper]"        # speech-to-text
pip install "audioql[diarization]"    # speaker diarization
pip install "audioql[events]"         # laughter, applause, music detection
pip install "audioql[all]"            # everything

Quickstart

from audioql import Audio

audio = Audio("meeting.mp3")

print(audio.duration)                  # seconds
print(audio.sample_rate)

transcript = audio.transcript()        # needs audioql[whisper]
print(transcript.text)
for seg in transcript.segments:
    print(seg.start, seg.end, seg.text)

print(audio.speakers())                # needs audioql[diarization]

for event in audio.find("laughter"):
    print(event.start, event.end, round(event.confidence, 2))

Analysis runs lazily and the results are cached, so calling timeline(), find(), transcript() and search() on the same Audio only analyzes the file once.

Configuration

Backends are configured with keyword arguments to Audio:

import os

audio = Audio(
    "meeting.mp3",
    whisper={"model": "small", "device": "cpu"},
    diarization={"hf_token": os.getenv("HF_TOKEN")},
)

hf_token also falls back to the HF_TOKEN environment variable, so most setups just work.

Hugging Face setup (required for diarization)

Speaker diarization downloads several models from the Hugging Face Hub, and two of them are gated: you need a Hugging Face account and the model owners must approve your access before the models can be downloaded. This is a one-time setup:

  1. Create a free account at huggingface.co/join.

  2. Open each model page below and click Agree and access repository to accept the user conditions:

    The speaker embedding model (pyannote/wespeaker-voxceleb-resnet34-LM) is public and needs no signup. If you instead use the community edition (pyannote/speaker-diarization-community-1), that repo is gated too and needs the same approval.

  3. Create an access token at huggingface.co/settings/tokens (a Read token is enough), then make it available to AudioQL. Either set the HF_TOKEN environment variable:

    # Windows (PowerShell)
    setx HF_TOKEN "hf_xxxx"
    
    # macOS / Linux
    export HF_TOKEN="hf_xxxx"
    

    or pass it directly to Audio:

    audio = Audio("meeting.mp3", diarization={"hf_token": "hf_xxxx"})
    

Transcript-only usage

transcript() also runs speaker diarization to attribute each segment to a speaker whenever the diarization extra is installed. If you only want the transcript (or haven't done the Hugging Face setup yet), disable the speaker plugin:

audio = Audio("meeting.mp3", disabled_plugins=["speaker"])
transcript = audio.transcript()

How it works

audio file
  → loader                 (decodes to mono float32)
  → plugins                (speech, speaker, events, silence)
  → timeline builder       (merges events, fills gaps, detects questions)
  → query engine           (find / search over the timeline)

Plugins are auto-enabled when their dependencies are installed, and disabled when they're not. You can also pass plugins and disabled_plugins to take full control.

Development

python -m venv .venv
.venv\Scripts\activate     # or: source .venv/bin/activate
pip install -e ".[dev]"
pytest

License

MIT

Metadata

Release files for audioql 0.1.4

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

Source distribution (sdist)

Source distribution for audioql 0.1.4
File Size Uploaded
audioql-0.1.4.tar.gz 35.1 kB Details

Built distribution (wheel)

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

Total release size: 67.4 kB

Release files / audioql-0.1.4.tar.gz

Download URL audioql-0.1.4.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ec937666a4a3fbbe7a1a142c4ba08987e14b5e5022e512964938485afba9f3c3
BLAKE2b-256 checksum
How to use checksums
e6008417cce3c070ab9d7f4a813ed4e2021d9f98bd642c461feacdfbbbb61a0f
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 Aug 5, 2026.

Transparency log

Release files / audioql-0.1.4-py3-none-any.whl

Download URL audioql-0.1.4-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d523f0bdfd78dfcc12b71348a996435a3d451a28c85b67b95793f8e22a9fe170
BLAKE2b-256 checksum
How to use checksums
316fdce7d8ee07ed9a85a99046de1a75bfffb3320c6e75398371e62307ab86dc
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 Aug 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.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