This commit is contained in:
Etienne Gaudrain
2025-03-28 12:10:48 +01:00
parent 1b7b8b6c6f
commit 3393ba4827
4 changed files with 141 additions and 1 deletions

View File

@@ -1,3 +1,15 @@
# scaled_soundfile
A thin wrapper around the `soundfile` module to allow saving files of any scales.
A thin wrapper around the `soundfile` module to allow saving files of any scales.
The `write` function rescales the input to normalize it and maximize the number of bits it is saved on. The RMS of the original sound is saved in the 'comment' metadata field as part of a JSON object. The files are saved as 'PCM_24'.
The `read` function loads the normalized data, and rescales it so that the RMS matches the original by reading the 'comment' metadata field if it exists.
In the current version of `soundfile` (and `libsndfile`) this only works with WAV files.
# Installation
```
pip install https://git.web.rug.nl/dBSPL/scaled_soundfile
```