# audio2numpy
[![Build Status](https://travis-ci.com/wiccy46/audio2numpy.svg?branch=master)](https://travis-ci.com/wiccy46/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](https://www.ostechnix.com/install-ffmpeg-linux/) 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?](https://www.java.com/en/download/help/path.xml))
## 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/wiccy46/audio2numpy",
"name": "audio2numpy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "audio, audio reader",
"author": "Jiajun Yang",
"author_email": "thejyang@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b5/5c/694a5887e20f472c7fa230795053c7d73319e03db3ff3aa87749e3d87b1a/audio2numpy-0.1.2.tar.gz",
"platform": "",
"description": "# audio2numpy\n[![Build Status](https://travis-ci.com/wiccy46/audio2numpy.svg?branch=master)](https://travis-ci.com/wiccy46/audio2numpy)\n\n## Description\n\naudio2numpy 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.\n\n## Installation\n\nUsing pip:\n\n pip install audio2numpy\n\n## FFmpeg for decoding mp3\naudio2numpy requires ffmpeg to decode mp3 files. You would need to install ffmpeg in order to have mp3 support. \n\n### macOS\n homebrew install ffmpeg\n\n### Linux\n sudo apt-get install ffmpeg\n[Check here](https://www.ostechnix.com/install-ffmpeg-linux/) for other installation methods for different Linux distributions. \n\n### Windows\n- Download the latest distribution from https://ffmpeg.zeranoe.com/builds/\n- Unzip the folder, preferably to `C:\\`\n- 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?](https://www.java.com/en/download/help/path.xml))\n\n## Usage\n\n from audio2numpy import open_audio\n fp = \"./examples/word.mp3\" # change to the correct path to your file accordingly\n signal, sampling_rate = open_audio(fp)\n\n## Version History\n\n**0.1.2 (20.08.2019)**\n\nAdd instructions to install ffmpeg if load mp3 failed with ffmpeg backend not available. \n\n**0.1.1 (14.08.2019)**\n\nInitial release.\n\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Load audio file to numpy array",
"version": "0.1.2",
"split_keywords": [
"audio",
" audio reader"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a2c6b056256f9aa7c25b051fde1c4249a83f9e331cb84b8de409cc0886a11ba5",
"md5": "17f14cd55b96ee512e48b4dd2a884ac7",
"sha256": "40e8e9364086879fa31561dc1948a5981a07c09486010dba2399b25a1bc6c844"
},
"downloads": -1,
"filename": "audio2numpy-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "17f14cd55b96ee512e48b4dd2a884ac7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10248,
"upload_time": "2019-08-21T13:14:49",
"upload_time_iso_8601": "2019-08-21T13:14:49.938784Z",
"url": "https://files.pythonhosted.org/packages/a2/c6/b056256f9aa7c25b051fde1c4249a83f9e331cb84b8de409cc0886a11ba5/audio2numpy-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b55c694a5887e20f472c7fa230795053c7d73319e03db3ff3aa87749e3d87b1a",
"md5": "9af1fc84407cc1504c3e56722e13d75b",
"sha256": "e0cbe2679c312ea86508758614299fac16b318bcb812da3221253d78613d00bb"
},
"downloads": -1,
"filename": "audio2numpy-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "9af1fc84407cc1504c3e56722e13d75b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 352015,
"upload_time": "2019-08-21T13:14:51",
"upload_time_iso_8601": "2019-08-21T13:14:51.634780Z",
"url": "https://files.pythonhosted.org/packages/b5/5c/694a5887e20f472c7fa230795053c7d73319e03db3ff3aa87749e3d87b1a/audio2numpy-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-08-21 13:14:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "wiccy46",
"github_project": "audio2numpy",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "audio2numpy"
}