Skip to main content

Babycat Logo

Babycat is an audio decoding and manipulation library

Intro

Babycat is a library that makes it easy to decode and manipulate many audio files at once.

Use Babycat with C, Python, Rust, or JavaScript/WebAssembly.

Babycat is written in Rust, has generated bindings for C, Python, and WebAssembly, and can be compiled to many different target architectures.

Babycat's bindings to Python allow for the concurrent decoding of many audio files without being slowed down by the Python Global Interpreter Lock (GIL), allowing you to get work done faster than you could in pure Python.

Babycat is permissively-licensed.

Babycat is licensed under the MIT license. Unlike many other libraries in the audio ecosystem,you can use Babycat in any project you want without any restrictions.

Babycat is battle-tested in industry.

Babycat was built at and is actively maintained by Neocrym, a record label that use artificial intelligence to find and promote the world's greatest musicians. Neocrym uses Babycat to decode millions of songs as part of audio feature engineering pipelines for training machine learning models.

Terminology

Babycat uses the same audio terminology as the Apple Core Audio API:

  • An audio stream is a continuous series of data that represents a sound, such as a song.
  • A channel is a discrete track of monophonic audio. A monophonic stream has one channel. A stereo stream has two channels. An audio stream that contains 5.1 surround sound will have five normal channels and one Low Frequency Enhancement (LFE) channel.
  • A sample is single numerical value in a single audio channel in an audio stream.
  • A frame is a collection of samples from the same point in time--one sample for each channel.
  • The frame rate (or sample rate) for a stream is the number of frames per second (hertz) of uncompressed audio.

Babycat stores audio as a single array of interleaved samples from channels. A waveform with two channels (e.g. left and right) are stored as:

[L R L R L R...]

We give every sample a two-dimensional index--first by frame and then by channel.

System requirements for compiling Babycat

Here is the software you will need if you want to compile your own changes to Babycat:

Rust 1.50 or newer

Babycat is written for stable Rust, targeting version 1.50.0 or newer.

GNU Make

GNU Make is a build system that Babycat uses to coordinate tasks.

If you are building Babycat on Windows, you should make sure that you have a Bash-compatible shell and GNU Make to run Babycat build commands with. On Windows, you can install GNU Make from the GNUWin32 project.

Many MacOS computers have the BSD version of Make, which might not parse Babycat's Makefile. To see which version of Make you have installed, run the command make --version. You should see GNU on the first line.

CMake

The CMake build system is necessary to compile Babycat with libsamplerate and other C/C++ dependencies.

A C compiler

Babycat is written in Rust, but a C compiler is needed to:

  • compile certain Babycat dependencies, such as libsamplerate.
  • compile and run the tests for Babycat's C bindings.

Any recent C compiler should work, but we prefer Clang/LLVM.

You can install a C compiler and build tools from your system package manager:

  • Ubuntu: apt-get install build-essential
  • Fedora: dnf install @development-tools
  • MacOS: xcode-select --install

On Windows, try installing the LLVM toolchain. There are Windows installers listed on the Pre-Built Binaries section of the LLVM releases page.

Python 3.6 or newer

Python 3.6 or newer is necessary for the following tasks:

  • Compiling the Babycat Python bindings
  • Using Babycat Python bindings
  • Linting and formatting Python code
  • Generating documentation using Sphinx

Node.js and NPM

Node.js and NPM are only necessary for running the Babycat WebAssembly tests. You should have Node.JS version 14 or newer. Node.js and NPM are only necessary for the following tasks:

  • Testing the Babycat WebAssembly bindings.
  • Linting and formatting the WebAssembly binding test source code.

OpenSSL development headers

wasm-pack and other dependencies need these headers. You can install these headers from your system package manager:

  • Ubuntu: apt-get install libssl-dev
  • Fedora: dnf install openssl-devel
  • MacOS: brew install openssl

libffi development headers

The CPython runtime, the Python cryptography package, and various other bits of code depend on the libffi development headers. You can install them from your system package manager:

  • Ubuntu: apt-get install libffi-dev
  • Fedora: dnf install libffi-devel
  • MacOS: brew install libffi

pkg-config (Linux only)

On Linux, the program pkg-config helps compilers find shared libraries. You can install pkg-config from your system package manager:

  • Ubuntu: apt-get install pkg-config
  • Fedora: dnf install pkgconf-pkg-config
  • MacOS: brew install pkg-config

ALSA headers (Linux only)

The Babycat command line program has the ability to paly audio through your system speakers. In order to compile this program on Linux, you will need the development headers for Advanced Linux Sound Architecture (ALSA).

You can install the ALSA development headers using your system package manager:

  • Ubuntu: apt-get install libasound2-dev
  • Fedora: dnf install alsa-lib-devel

cbindgen

cbindgen is a tool that we use to generate Babycat's C bindings. You can install it with the command cargo install cbindgen.

wasm-pack

wasm-pack is a tool that we use to generate Babycat's WebAssembly bindings. You can install it with the command cargo install wasm-pack.

Before you install wasm-pack, make sure you have already installed the OpenSSL development headers (see above).

Docker and Docker Compose

Docker is not necessary to build or use Babycat, but the Babycat repository contains a few Docker images that are useful for testing.

Docker is also required for building a Babycat Python wheel that obeys the manylinux protocol--which is a requirement for building a binary Python wheel that is compatible with most Linux systems.

To use these images, install Docker and Docker Compose. The Docker website has installers for Docker Desktop here and Docker Compose here.

clang-format

clang-format is a tool that ships with the Clang compiler. Babycat uses it to automatically format the code for our C binding tests. If you already use Clang, you might already have clang-format installed. If not, you can install clang-format from your system package manager:

  • Ubuntu: apt-get install clang-format
  • Fedora: dnf install clang-tools
  • MacOS: brew install clang-format

On Windows, the best way to get clang-format is to download and install the LLVM toolchain. You can find Windows installers under the Pre-Built Binaries section of the LLVM releases page.

Acknowledgements

The first version of Babycat was an internal project at Neocrym written by Ritik Mishra. Since then, the code has been extended and open-sourced by James Mishra.

Babycat is built on top of many high-quality open source packages, including:

Metadata

Release files for babycat 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for babycat 0.0.3
File Interpreter ABI Platform Actions
babycat-0.0.3-cp36-abi3-win_amd64.whl CPython 3.6 abi3 Windows x86-64 Details for babycat-0.0.3-cp36-abi3-win_amd64.whl
babycat-0.0.3-cp36-abi3-manylinux1_x86_64.whl CPython 3.6 abi3 Linux glibc 2.5+ x86-64 Details for babycat-0.0.3-cp36-abi3-manylinux1_x86_64.whl
babycat-0.0.3-cp36-abi3-macosx_10_7_x86_64.whl CPython 3.6 abi3 macOS 10.7+ x86-64 Details for babycat-0.0.3-cp36-abi3-macosx_10_7_x86_64.whl

Total release size: 7.0 MB

Release files / babycat-0.0.3-cp36-abi3-win_amd64.whl

Download URL babycat-0.0.3-cp36-abi3-win_amd64.whl
Size 2.0 MB
Tags CPython 3.6 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
67352f6448fbc157fbd889106e70bad1b607948970bcf1287c6f6566f340ab95
BLAKE2b-256 checksum
How to use checksums
95ff767d6857cf655fbb719a768032e71fa78dc44d19107afb4d4b8f4ca5d736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

Release files / babycat-0.0.3-cp36-abi3-manylinux1_x86_64.whl

Download URL babycat-0.0.3-cp36-abi3-manylinux1_x86_64.whl
Size 2.9 MB
Tags CPython 3.6 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
a9d96837add4d914f245aa1c847df5b22d5c4f187c21676c514ed3f683607c93
BLAKE2b-256 checksum
How to use checksums
526aabb52993b3a47d8a046e1d98c79f53520509a2651804e0db579ab147c2dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

Release files / babycat-0.0.3-cp36-abi3-macosx_10_7_x86_64.whl

Download URL babycat-0.0.3-cp36-abi3-macosx_10_7_x86_64.whl
Size 2.1 MB
Tags CPython 3.6 abi3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
9714f5410f77cd5e37dfa6b64f3461846c2d923d53bd7629188d986ed7652ec3
BLAKE2b-256 checksum
How to use checksums
56dbd57fd0fe48287d415419e5ba2ef36817f8f71525dc393a021547783c315b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

Security for babycat 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page