Soundhub Utils
Audio processing utilities library for SoundHub model integration. This package provides core functionality for:
- Reading audio files from AWS S3, Google Cloud Storage, HTTPS URLs, and local filesystems
- Standard audio preprocessing (resampling, segmentation, format conversion)
- Spectrogram generation using multiple backends (TensorFlow, PyTorch, librosa)
- Unified I/O interface across different storage platforms
Note: This is a utilities library. For running models (like OWL), see soundhub_model_runner.
Table of Contents
Installation
Using Pixi (Recommended for Development)
Requirements are managed through Pixi. Install pixi, then:
# Run commands in the pixi environment
pixi run python -c "import soundhub_utils; print(soundhub_utils.__version__)"
# Launch jupyter for development
pixi run jupyter lab .
The pyproject.toml includes soundhub_utils = { path = ".", editable = true }, so no separate installation is needed.
Using pip
# Install from local directory
pip install -e .
# Or install specific version (when published to PyPI)
pip install soundhub-utils
Core Modules
I/O (soundhub_utils.io)
Unified interface for reading/writing audio files across multiple storage platforms:
soundhub_utils.io.aws: AWS S3 integration with partial FLAC download supportsoundhub_utils.io.gcs: Google Cloud Storage operationssoundhub_utils.io.local: Local filesystem operationssoundhub_utils.io.url: HTTP/HTTPS streaming and downloadssoundhub_utils.io.io: Unified interface that auto-routes based on URI scheme
Audio Processing (soundhub_utils.audio)
Audio processing backends for spectrogram generation and preprocessing:
soundhub_utils.audio.tensorflow_audio: TensorFlow-native audio processing
Utilities (soundhub_utils.utils)
Helper functions for audio processing:
soundhub_utils.utils.audio: Format conversion and validationsoundhub_utils.utils.flac: FLAC metadata extraction and time-range processingsoundhub_utils.names: File naming conventions for audio and spectrograms
Usage Examples
Reading Audio from Different Sources
from soundhub_utils.io import io
# Read from S3
audio_data = io.read_flac("s3://bucket/path/audio.flac")
# Read from Google Cloud Storage
audio_data = io.read_flac("gs://bucket/path/audio.flac")
# Read from HTTPS URL
audio_data = io.read_flac("https://example.com/audio.flac")
# Read from local file
audio_data = io.read_flac("/path/to/audio.flac")
# Read partial FLAC (time range)
audio_data = io.read_partial_flac(
"s3://bucket/audio.flac",
start_time=10.0, # seconds
duration=30.0 # seconds
)
Generating Spectrograms
from soundhub_utils.audio import tensorflow_audio
# Generate spectrograms from audio file
spectrograms = tensorflow_audio.generate_spectrograms(
audio_path="/path/to/audio.flac",
sample_rate=8000,
segment_duration=12.0,
spectrogram_shape=[257, 1000]
)
Style Guide
Following PEP8. See setup.cfg for exceptions. Use pycodestyle . to check compliance.
License
BSD 3-Clause
Metadata
Release files for soundhub-utils 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| soundhub_utils-0.5.2.tar.gz | 29.2 kB | Without provenance | Details for soundhub_utils-0.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| soundhub_utils-0.5.2-py3-none-any.whl | Python 3 | none | any | Details for soundhub_utils-0.5.2-py3-none-any.whl |
Total release size: 69.6 kB
Release files / soundhub_utils-0.5.2.tar.gz
| Download URL | soundhub_utils-0.5.2.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
554030d2363212a0dcdb46468ab435f40875c161fc4c91a3cccb186ff7e5d7fe
|
|
BLAKE2b-256 checksum How to use checksums |
37f7fde076b5270a9cbac2a0237d4797a7fa4d8126d1046a027ccafcbab7f663
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / soundhub_utils-0.5.2-py3-none-any.whl
| Download URL | soundhub_utils-0.5.2-py3-none-any.whl |
|---|---|
| Size | 40.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02d4a7746d179e59fc08e5f743c3a7c5d6c95aaa38b8abd1d2e0ddb65af94dd2
|
|
BLAKE2b-256 checksum How to use checksums |
b4a1e068efe21f48f27e11c6917fc194b41b663740d05bd97761451ddc644883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for soundhub-utils 0.5.2
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.