Skip to main content

Numcodecs implementation of WavPack audio codec.

Project description

PyPI version tests

WavPack - numcodecs implementation

Numcodecs wrapper to the WavPack audio codec.

This implementation enables one to use WavPack as a compressor in Zarr.

Requirements

To install wavpack-numcodecs on MacOS, you need to install wavpack with brew:

brew install wavpack

For Linux and Windows, the package comes with pre-built binaries of the most recent version Wavpack version.

On Linux, if an existing wavpack installation is found, the package will use it. Otherwise, it will use the pre-built binaries available in the wavpack_numcodecs/libraries folder.

Installation

Install via pip:

pip install wavpack-numcodecs

Or from sources:

git clone https://github.com/AllenNeuralDynamics/wavpack-numcodecs.git
cd wavpack_numcodecs
pip install .

Usage

This is a simple example on how to use the WavPackCodec with zarr:

from wavpack_numcodecs import WavPack

data = ... # any numpy array

# instantiate WavPack compressor
wv_compressor = WavPack(level=2, bps=None)

z = zarr.array(data, compressor=wv_compressor)

data_read = z[:]

Available **kwargs can be browsed with: WavPack?

NOTE: In order to reload in zarr an array saved with the WavPack, you just need to have the wavpack_numcodecs package installed.

Developmers guide

How to upgrade WavPack installation

To upgrade the WavPack installation, you need to:

  1. Download the latest version of WavPack from the official website.
  2. Extract the content of the downloaded file.
  3. Create a new folder in the src/wavpack_numcodecs/libraries folder with the name of the version of the WavPack you are installing.
  4. Add the Windows .dll and .lib files to the windows-x86_32 and windows-x86_64 folders, respectievely.
  5. Build the Linux shared library and copy the .so file to the linux-x86_64 folder.
  6. Set the LATET_WAVPACK_VERSION variable in the setup.py to match the version of the WavPack you are installing.
  7. Update the version of the CI workflows in the .github/workflows/ folder.

Project details


Download files

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

Source Distribution

wavpack-numcodecs-0.2.0.tar.gz (2.0 MB view details)

Uploaded Source

File details

Details for the file wavpack-numcodecs-0.2.0.tar.gz.

File metadata

  • Download URL: wavpack-numcodecs-0.2.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for wavpack-numcodecs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 57eeefc0fedb253e4ceb1d6eeec8690b15e8bc10e88ebb66c7006db6ae609b88
MD5 9776d635a52832d5fbf2db1caf57bfb0
BLAKE2b-256 3ac5db3979a638a1e774faa0609eeb90366141c9aaeabf7fa050c509d607a28e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page