Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Load audio file to numpy array

Project description

audio2numpy

Build Status

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for audio2numpy, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size audio2numpy-0.1.2-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size audio2numpy-0.1.2.tar.gz (352.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page