DFPWM convertor for Python
Project description
DFPWM
DFPWM convertor for Python
Usage
from pathlib import Path
import soundfile as sf # for reading audio
import dfpwm
data, sample_rate = sf.read('./someaudio.mp3') # read audio
# If sample rate is not 48000, may get strange result
# use `dfpwm.resample(...)` to resample
if sample_rate != dfpwm.SAMPLE_RATE:
raise ValueError(f"{sample_rate} != {dfpwm.SAMPLE_RATE}")
if len(data.shape) != 0 and data.shape[1] > 1:
data = data[:, 0] # get channel 0
data = dfpwm.compressor(channel0) # convert
Path('out.dfpwm').write_bytes(data) # write result to file
Build from source
Clone
git clone https://github.com/CyanChanges/python-dfpwm.git python-dfpwm
cd python-dfpwm
Build
This project use poetry
to build,
Make sure poetry
is installed.
poetry build -f sdist
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
dfpwm-0.1.4.tar.gz
(160.1 kB
view hashes)
Built Distribution
Close
Hashes for dfpwm-0.1.4-cp311-cp311-manylinux_2_38_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4be79ff81934960fbddac9ca518802dd50f6d15296203c9437c3be062be03ffd |
|
MD5 | 34341e176900a743812542db01eafe99 |
|
BLAKE2b-256 | 3de317146c9208079500b170e28811bc376676d7911d6418f78dc8a913617ab2 |