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.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2d6baa569d4134d587d8f12474c043aa72e9ed59d336275dd1bbd108f8f6546 |
|
MD5 | e9a775560c6d8409df4b89dfc54e1270 |
|
BLAKE2b-256 | 15d68770e3e29a4a7f06dfacb63e121aff385dfa39a9f3e505993d4ac8fa6f17 |