Load audio file to numpy array
Project description
audio2numpy
Description
audio2numpy load an audio file and directly ouputs the audio data as a numpy array and its sampling rate. Supports .wav, .aiff via python's standard library, and .mp3 via ffmpeg.
Installation
Using pip:
pip install audio2numpy
FFmpeg for decoding mp3
audio2numpy requires ffmpeg to decode mp3 files. You would need to install ffmpeg in order to have mp3 support.
macOS
homebrew install ffmpeg
Linux
sudo apt-get install ffmpeg
Check here for other installation methods for different Linux distributions.
Windows
- Download the latest distribution from https://ffmpeg.zeranoe.com/builds/
- Unzip the folder, preferably to
C:\
- Append the FFmpeg binary folder (e.g.
C:\ffmpeg\bin
) to the PATH system variable (How do I set or change the PATH system variable?)
Usage
from audio2numpy import open_audio
fp = "./examples/word.mp3" # change to the correct path to your file accordingly
signal, sampling_rate = open_audio(fp)
Version History
0.1.2 (20.08.2019)
Add instructions to install ffmpeg if load mp3 failed with ffmpeg backend not available.
0.1.1 (14.08.2019)
Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file audio2numpy-0.1.2.tar.gz
.
File metadata
- Download URL: audio2numpy-0.1.2.tar.gz
- Upload date:
- Size: 352.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0cbe2679c312ea86508758614299fac16b318bcb812da3221253d78613d00bb |
|
MD5 | 9af1fc84407cc1504c3e56722e13d75b |
|
BLAKE2b-256 | b55c694a5887e20f472c7fa230795053c7d73319e03db3ff3aa87749e3d87b1a |
File details
Details for the file audio2numpy-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: audio2numpy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40e8e9364086879fa31561dc1948a5981a07c09486010dba2399b25a1bc6c844 |
|
MD5 | 17f14cd55b96ee512e48b4dd2a884ac7 |
|
BLAKE2b-256 | a2c6b056256f9aa7c25b051fde1c4249a83f9e331cb84b8de409cc0886a11ba5 |