Skip to main content

A mixed Rust and Python crate/package for reading and writing WAVE files. Exposes the Rust crate Wavers to Python.

Project description

PyWaveRS - WaveRs but for Python

crate-pywavers-img crate-pywavers-docrs-img crate-pywavers-readdocs-img Crates.io Documentation

WaveRs (pronounced wavers) is a Wav file reader/writer written in Rust and designed to fast and easy to use. WaveRs is also available in Python through the PyWaveRs package.

Getting Started · Benchmarks


Getting Started

Benchmarks

dtype PyWavers SoundFile SciPy TorchAudio (Sox) TorchAudio (SoundFile) TensorFlow Audio-IO
int16 18.0455 31.505 16.8316 195.954 191.826 49.0038
int32 35.8505 141.546 nan nan nan nan
float32 43.3757 203.17 nan 228.13 225.659 nan
float64 81.4131 206.821 nan 324.17 315.95 nan

All times are in microseconds μs and are the time taken (on average) to load a single file from the set of test files. Timings were only taken when the library could load and automatically convert the file to another type of sampled audio data. Only PyWavers and Soundfile have this functionality built in. For the cases of f32 and f64 the conversion involves just casting to the other type therefore the times are included where applicable.

The NaNs present in the benchmarks table incidate the the library could not automatically load and convert to that data type. For example, SciPy loads the native encoding of the file, it isn't that it can't load a file, it just can't convert it to another type of sampled audio data. The same occurs with Tensorflow. PyTorch has the options of normalizing or not normalizing the data (as f32 or native encoding), but it doesn't have the option to convert to another type of sampled audio data, such as between i16 and i32.

The wav files included in the test set are between 7 and 15 seconds long. They are all encoded as PCM-16. The benchmarks were taken using Wavers v1.4.3.

Reading i16
Benchmark results for reading PCM-16 encoded wav files.

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

pywavers-0.1.0.tar.gz (476.3 kB view hashes)

Uploaded Source

Built Distribution

pywavers-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (306.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

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