Skip to main content

Common API for reading writing soundfiles

Project description

This package provides a simple and unified API to read and write sound-files to and from numpy arrays.

API

sndread

  • reads all the samples (or a fragment) from a soundfile and returns a tuplet (data, samplerate)

  • Data will always be as a numpy.float64, between -1 and 1, independently of bit-rate

sndread_chunked

  • reads chunks of frames, avoiding the allocation of all the samples in memory

sndinfo

  • returns SndInfo, a namedtuple with all the information of the sound-file

sndwrite

  • writes the samples.

  • samples need to be a numpy.float64 array with data between -1 and 1

sndwrite_chunked

  • allows you to write to the file as samples become available

resample

Resample a numpy array to a new samplerate

Installation

Make sure that you have libsamplerate installed.

pip install sndfileio

Dependencies

  • libsamplerate (apt install libsndfile1-dev)

All python dependencies are installed by pip

License

See the LICENSE file for license rights and limitations (MIT).

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

sndfileio-1.2.0.tar.gz (15.9 kB view details)

Uploaded Source

File details

Details for the file sndfileio-1.2.0.tar.gz.

File metadata

  • Download URL: sndfileio-1.2.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for sndfileio-1.2.0.tar.gz
Algorithm Hash digest
SHA256 aa0d9fc441e588d4c62a67f327a3e1ed3f69523325289812b6e02dd8117587b0
MD5 79be54b84aa8f82288eae128c0df30e0
BLAKE2b-256 0cfe0acd22f159dac7082838cd63075ffedc58000b75d08ebec4b364d29af7f4

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page