Audiofile
Handling audio files in Python
Install / Use
/learn @audeering/AudiofileREADME
========= audiofile
|tests| |coverage| |docs| |python-versions| |license|
The Python package audiofile handles all kind of audio files
with a focus on reading speed_.
It can read and request information on channels, duration, number of samples and sampling rate for all files that are supported by ffmpeg_, sox_, and mediainfo_. In addition, it can write WAV, FLAC, MP3, and OGG files.
Have a look at the installation_ and usage_ instructions as a starting point.
Code example for reading a file:
.. code-block:: python
import audiofile
signal, sampling_rate = audiofile.read("signal.wav")
Under the hood it uses soundfile_ to read the audio files, converting non-supported formats first to WAV files. The same approach is applied when requesting duration for formats that need to be decoded to ensure that duration and number of samples match.
.. _ffmpeg: https://www.ffmpeg.org/ .. _installation: https://audeering.github.io/audiofile/installation.html .. _mediainfo: https://mediaarea.net/en/MediaInfo/ .. _usage: https://audeering.github.io/audiofile/usage.html .. _reading speed: https://audeering.github.io/audiofile/benchmark.html .. _sox: https://sourceforge.net/projects/sox/ .. _virtualenv: https://virtualenv.pypa.io/ .. _soundfile: https://python-soundfile.readthedocs.io/
.. |tests| image:: https://github.com/audeering/audiofile/workflows/Test/badge.svg :target: https://github.com/audeering/audiofile/actions?query=workflow%3ATest :alt: Test status .. |coverage| image:: https://codecov.io/gh/audeering/audiofile/branch/main/graph/badge.svg?token=LVF0621BKR :target: https://codecov.io/gh/audeering/audiofile/ :alt: code coverage .. |docs| image:: https://img.shields.io/pypi/v/audiofile?label=docs :target: https://audeering.github.io/audiofile/ :alt: audiofile's documentation .. |python-versions| image:: https://img.shields.io/pypi/pyversions/audiofile.svg :target: https://pypi.org/project/audiofile/ :alt: audiofile's supported Python versions .. |license| image:: https://img.shields.io/badge/license-MIT-green.svg :target: https://github.com/audeering/audiofile/blob/main/LICENSE :alt: audiofile's MIT license
Related Skills
qqbot-channel
349.2kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.3k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
349.2kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
arscontexta
3.0kClaude Code plugin that generates individualized knowledge systems from conversation. You describe how you think and work, have a conversation and get a complete second brain as markdown files you own.
