Numcodecs wrapper to the FLAC audio codec using pyFLAC.
This implementation enables one to use FLAC as a compressor in Zarr.
Install via pip:
pip install flac-numcodecs
Or from sources:
git clone https://github.com/AllenNeuralDynamics/flac-numcodecs.git
cd flac-numcodecs
pip install .
This is a simple example on how to use the Flac codec with zarr:
from flac_numcodecs import Flac
data = ... # any numpy array
# instantiate Flac compressor
flac_compressor = Flac(level=5)
z = zarr.array(data, compressor=flac_compressor)
data_read = z[:]
Available **kwargs can be browsed with: Flac?
NOTE:
In order to reload in zarr an array saved with the Flac, you just need to have the flac_numcodecs package
installed.