No project description provided
Project description
soundstream-light
Minimal SoundStream encoder/decoder tooling with a native C++ CLI and a Python API.
Python Usage (PyPI)
Install package with uv,
uv pip install soundstream-light
Use soundstream_light in Python,
from scipy.io import wavfile
import numpy as np
from soundstream_light import encode, decode
rate, pcm = wavfile.read("test.wav")
waveform = pcm.astype(np.float32) / 32768.0
embeddings, meta = encode(waveform)
recon = decode(embeddings, metadata=meta)
wavfile.write("test_recon.wav", rate, (np.clip(recon, -1.0, 1.0) * 32768.0).astype(np.int16))
The module auto-downloads models on first use if they are missing.
Fetch Models
Use the bundled CLI to download the required .tflite files manually (defaults to ./models or SOUNDSTREAM_MODELS_DIR). If you are working from the repository, prefix the command with uv run so the local package is used.
uv run soundstream-cli models fetch
With models present, you can test the encoder/decoder round trip using the bundled test.wav example:
uv run soundstream-cli encode test.wav test.embeddings
uv run soundstream-cli decode test.embeddings test_recon.wav
Build from source
You can also build from source code by cloning this repo. Make sure that git, cmake, a C++17 compiler, and typical build tools (e.g. make, ninja, perl) are available.
Prepare TensorFlow Lite headers and libraries:
bash scripts/setup_tflite_from_source.sh --clean --branch v2.15.0 --generator Ninja --build-type Release
Configure and build:
cmake -S . -B build \
-DTFLITE_SOURCE_DIR="$(pwd)/third_party/tflite-src" \
-DTFLITE_BUILD_DIR="$(pwd)/third_party/tflite-src/cmake_build"
cmake --build build --target soundstream_cli
The binary appears at build/soundstream_cli. Then build PyPI artifacts from source,
export TFLITE_SOURCE_DIR="$(pwd)/third_party/tflite-src"
export TFLITE_BUILD_DIR="$(pwd)/third_party/tflite-src/cmake_build"
uv build
Verify the Build
Run the C++ round-trip test (requires models):
# Download models once if you haven't already
uv pip install dist/soundstream_light-*.whl
uv run soundstream-cli models fetch
cmake --build build --target soundstream_roundtrip_test
ctest --test-dir build --output-on-failure
Python unit tests can be executed without compiling the extension:
uv run python -m unittest tests.test_api
License
Apache License 2.0 — see LICENSE.
Acknowledgements
This project builds on the source code of Lyra.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soundstream_light-0.1.3.tar.gz.
File metadata
- Download URL: soundstream_light-0.1.3.tar.gz
- Upload date:
- Size: 469.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f44882a2dbfed1235a7c8124debd553a99938b80868cc1941859fdfa0aa4c8a
|
|
| MD5 |
1b1801fd1ec5be73c5dfb6c9692495ea
|
|
| BLAKE2b-256 |
5ab9dcb9b161402f0706957089afd0445d8497684b1d4907a457e81488b37f31
|
Provenance
The following attestation bundles were made for soundstream_light-0.1.3.tar.gz:
Publisher:
publish.yml on binbinsh/soundstream-light
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soundstream_light-0.1.3.tar.gz -
Subject digest:
9f44882a2dbfed1235a7c8124debd553a99938b80868cc1941859fdfa0aa4c8a - Sigstore transparency entry: 675865478
- Sigstore integration time:
-
Permalink:
binbinsh/soundstream-light@49f42b09d066e8000f41d3cfd05af3ff632aa8c2 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/binbinsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@49f42b09d066e8000f41d3cfd05af3ff632aa8c2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file soundstream_light-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: soundstream_light-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e297fdeb36441048d821b5c7406c1bba47a5b944079908d7329985eb1215f686
|
|
| MD5 |
0c4000d5c32e2e7f9c6c2da817be55bd
|
|
| BLAKE2b-256 |
76101abfef67b1eecf62b1420819aac7f017113272f67180431285f85ce9bc5e
|
Provenance
The following attestation bundles were made for soundstream_light-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl:
Publisher:
publish.yml on binbinsh/soundstream-light
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soundstream_light-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl -
Subject digest:
e297fdeb36441048d821b5c7406c1bba47a5b944079908d7329985eb1215f686 - Sigstore transparency entry: 675865525
- Sigstore integration time:
-
Permalink:
binbinsh/soundstream-light@49f42b09d066e8000f41d3cfd05af3ff632aa8c2 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/binbinsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@49f42b09d066e8000f41d3cfd05af3ff632aa8c2 -
Trigger Event:
workflow_dispatch
-
Statement type: