No project description provided
Project description
Torch Pitch Shift
Pitch-shift audio clips quickly with PyTorch (CUDA Supported)!
About
This library can pitch-shift audio clips quickly to using PyTorch.
Installation
pip install torch_pitch_shift
Usage
Example:
import torch
import numpy as np
from scipy.io import wavfile
from torch_pitch_shift import *
SAMPLE_RATE, sample = wavfile.read("./wavs/test.wav")
dtype = sample.dtype
sample = torch.tensor(np.swapaxes(sample, 0, 1), dtype=torch.float32)
pitch_shift = PitchShifter()
up = pitch_shift(sample, 12, SAMPLE_RATE)
wavfile.write(
"./wavs/test_+1.wav",
SAMPLE_RATE,
np.swapaxes(up.numpy(), 0, 1).astype(dtype),
)
down = pitch_shift(sample, -12, SAMPLE_RATE)
wavfile.write(
"./wavs/test_-1.wav",
SAMPLE_RATE,
np.swapaxes(down.numpy(), 0, 1).astype(dtype),
)
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
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
Built Distribution
Close
Hashes for torch_pitch_shift-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a22215fd7fcf90f05da4e8247a43603733144fed23532aded115bfae21008978 |
|
MD5 | a8458cc48332264ca1a1d5cf1d1e7f60 |
|
BLAKE2b-256 | 8af1e5c5f0125479e9ab601071055a27b32ac7312e6a4645eade0a478c6fb33a |