Skip to main content

No project description provided

Project description

Torch Pitch Shift

Pitch-shift audio clips quickly with PyTorch (CUDA Supported)!

View on PyPI

Publish to PyPI

Installation

pip install torch_pitch_shift

Usage

# import the libs
import torch
from torch_pitch_shift import *

# create a random sample
NUM_CHANNELS = 2
SAMPLE_RATE = 44100
NUM_SECONDS = 2
sample = torch.rand(NUM_CHANNELS, SAMPLE_RATE * NUM_SECONDS, dtype=torch.float32)
# you can also use CUDA tensors (either with device= or .cuda())!

# construct the pitch shifter
pitch_shift = PitchShifter(SAMPLE_RATE)

# pitch shift the sample
SHIFT_SEMITONES = 5
print(pitch_shift(sample, SHIFT_SEMITONES))

Documentation

Documentation is built into the class and function docstrings. If anyone wants to properly document the package, please feel free to contribute!

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

torch_pitch_shift-1.0.3.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

torch_pitch_shift-1.0.3-py3-none-any.whl (89.4 kB view hashes)

Uploaded Python 3

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