Skip to content

A Python library for loading sound files with `soundfile`, `xarray` and optionally `dask` support.

License

Notifications You must be signed in to change notification settings

FRidh/xoundfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xoundfile

A Python library for loading sound files with soundfile, xarray and optionally dask support.

Example

Lazy data array. Use compute() to load it or perform an operation on it:

import xoundfile as xf
arr = xf.open(filename)
arr + 1.

Using Dask:

arr = xf.open(filename, chunks=(None, 2))
(arr + 1.).arr.compute()

Or if you have multiple files that you'd like to merge into a single array:

open = lambda filename: xf.open(filename, chunks(None, None))
arr = xr.concat((map(open, files)), dim="files")
arr.mean()

Note indexing and chunking is currently far from optimal.

About

A Python library for loading sound files with `soundfile`, `xarray` and optionally `dask` support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published