Skip to main content

DFPWM convertor for Python

Project description

DFPWM

DFPWM convertor for Python

Installation

From PyPI

You can get this package from PyPI if you are in py311 Linux x86

pip install dfpwm

Build from source

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

dfpwm = dfpwm.compressor(data)  # convert
Path('out.dfpwm').write_bytes(dfpwm)  # 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

Project details


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.6.tar.gz (164.6 kB view hashes)

Uploaded Source

Built Distribution

dfpwm-0.1.6-cp311-cp311-manylinux_2_38_x86_64.whl (693.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.38+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page