Skip to main content
https://travis-ci.org/acelletti/wavy.svg?branch=master https://coveralls.io/repos/github/acelletti/wavy/badge.svg?branch=travisci https://img.shields.io/appveyor/tests/acelletti/wavy.svg https://img.shields.io/github/license/acelletti/wavy.svg https://readthedocs.org/projects/wavy/badge/?version=latest

Introduction

A pure python module for working with WAVE files with support for all common file formats for both RIFF and RIFX.

When working with WAVE files, there are two main pure python modules available:

  • builtin.wave

    Python built-in module, lacks support for float and 24bit integer. Provides raw data instead of an array of values.

  • scipy.wave

    Scipy does not support 24bit integer files. The module strength and weakness is its simplicity, if all you need to do is read and write, this might be for you.

The wave module provides a fully featured dedicated module that can be used as an alternative to the above if flexibility and ease of use are desirable.

Comparison

The following table shows a comparison of supported functionality:

Functionality

builtin.wave

scipy.wave

wavy

RIFF Format Support

check-circle

check-circle

check-circle

RIFX Format Support

times-circle

check-circle

check-circle

Read Audio Information

check-circle

times-circle

check-circle

Read Data As Array

times-circle

check-circle

check-circle

Read Tag Information

times-circle

times-circle

check-circle

The following table shows a comparison of supported formats for uncompressed WAVE files:

Sample Width

Format Tag

builtin.wave

scipy.wave

wavy

8 bit

PCM

check-circle

check-circle

check-circle

EXTENSIBLE

times-circle

check-circle

check-circle

16 bit

PCM

check-circle

check-circle

check-circle

EXTENSIBLE

times-circle

check-circle

check-circle

24 bit

PCM

check-circle

times-circle

check-circle

EXTENSIBLE

times-circle

times-circle

check-circle

32 bit

PCM

check-circle

check-circle

check-circle

EXTENSIBLE

times-circle

check-circle

check-circle

FLOAT

times-circle

check-circle

check-circle

64 bit

FLOAT

times-circle

check-circle

check-circle

Installation

The latest stable version is available on PyPI.

Either add wavy to your requirements.txt file or install with pip:

pip install wavy

Usage

Read File

Open a file using the module use wavy.read:

>>> import wavy
>>> file = wavy.read("audio.wav")
>>> file
WaveFile(sample_width=16, framerate=44100, n_channels=2, n_frames=286653)

Get the data for the file:

>>> rate, data = file.framerate, file.data

>>> rate
44100

>>> data.shape
(286653, 2)

>>> data.dtype
int16

Get File Info

To read the file information without loading the data use wavy.info:

>>> wavy.info("audio.wav")
WaveFileInfo(sample_width=16, framerate=44100, n_channels=2, n_frames=286653, tags=None)

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Release files for wavy 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wavy 1.0.1
File Size Uploaded
wavy-1.0.1.tar.gz 28.0 kB Details

Release files / wavy-1.0.1.tar.gz

Download URL wavy-1.0.1.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1833b333a266e81203c12bed1aed5f22c9376926cb24138522349f4b4339ef2a
BLAKE2b-256 checksum
How to use checksums
9d1066046f6aedfa3a7849482283a8cf8b1c784fcbb76012d1fd3800f11e8f19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

0.1.4

1 release file

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page