audiofile
Fast reading of all kind of audio files
What it is and what it does
audiofile is a Python library for reading and writing audio files with a focus on reading speed. It abstracts away the complexity of working with multiple audio formats by leveraging ffmpeg, sox, and mediainfo for format conversion and metadata extraction, while using soundfile as its core reader. The package provides a simple API to extract signal data and metadata (channels, duration, samples, sampling rate) from any format those tools support, and can write to WAV, FLAC, MP3, and OGG.
The main use case is audio processing pipelines where you need to work with heterogeneous audio sources without worrying about format-specific handling. It automatically converts unsupported formats to WAV before reading, ensuring consistent behavior across your codebase. The dependency stack includes audeer, audmath, numpy, and soundfile, making it suitable for scientific and research applications that need reliable, fast audio I/O.
Use it for:
- Extract audio signals and metadata from mixed audio formats in a batch processing pipeline.
- Build audio feature extraction workflows that accept files in any format ffmpeg or sox supports.
- Convert and standardize audio files to WAV, FLAC, MP3, or OGG in a research or production system.
- Read audio duration and sample counts reliably across formats without manual format detection.
- Integrate audio file handling into machine learning preprocessing steps with minimal boilerplate.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and writes audio files across formats supported by ffmpeg, sox, and mediainfo, with optimized reading speed and metadata extraction for channels, duration, samples, and sampling rate.
Yes. audiofile is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers low install friction. It solves a real problem—unified, fast audio I/O across formats—with a simple API. Install it if you work with audio files in multiple formats and want to avoid format-specific code.
Install
audiofile on PyPI
pip
pip install audiofileuv
uv add audiofilepoetry
poetry add audiofileInstalling audiofile
Before you install
Low install friction with a pure-Python wheel and four runtime dependencies. Active maintenance with a recent commit on 2026-08-05 and stable production status.
License in practice
MIT license permits commercial and private use with minimal restrictions; attribution required.
Quickstart
pip install audiofile
import audiofile
signal, sampling_rate = audiofile.read("signal.wav")
Requires ffmpeg, sox, or mediainfo installed on the system for format conversion and metadata extraction of non-WAV formats.
Verify before relying
- Whether the package handles edge cases like corrupted or truncated audio files gracefully.
- Performance benchmarks comparing reading speed across different audio formats and file sizes.
- Exact behavior when writing formats (WAV, FLAC, MP3, OGG) with various codec options or quality settings.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — audeer, audmath, numpy, soundfile |
| Maintenance | actively maintained — 86 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 90,602/month — #13,573 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: audiofile-1.6.1-py3-none-any.whl
Keywords: audio, tools
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
audiolabaudiolab loads, processes, and saves audio…
permissive · top 15,000 on PyPI
audioreadDecode audio files using whichever backend is…
permissive · top 5,000 on PyPI
SigMFReads and writes Signal Metadata Format (SigMF)…
copyleft · top 15,000 on PyPI
soundfileReads and writes audio files in formats like…
permissive · top 1,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
miniaudioMiniaudio provides Python bindings for…
permissive · top 15,000 on PyPI
mutagenMutagen reads and writes audio metadata (tags)…
copyleft · top 5,000 on PyPI
knowitExtracts detailed metadata from media files…
permissive · top 15,000 on PyPI
soxPython wrapper that exposes SoX audio…
permissive · top 5,000 on PyPI
mediafileMediaFile reads and writes metadata tags across…
permissive · top 15,000 on PyPI