No project description provided
Project description
Torch Pitch Shift
Pitch-shift audio clips quickly with PyTorch (CUDA supported)! Additional utilities for searching efficient transformations are included.
View on PyPI / View Documentation
About
This package includes two main features:
- Pitch-shift audio clips quickly using PyTorch (with CUDA support)
- Calculate efficient pitch-shift targets (useful for augmentation, where speed is more important than precise pitch-shifts)
Installation
pip install torch_pitch_shift
Usage
Example
It's super simple:
# import libraries
import torch
from torch_pitch_shift import *
# specify the sample rate
SAMPLE_RATE = 16000
# create a random stereo audio clip (1s long)
audio = torch.rand(
2,
SAMPLE_RATE,
device="cuda" if torch.cuda.is_available() else "cpu"
)
# create the pitch shifter
pitch_shift = PitchShifter()
# for fast shift targets between -1 and +1 octaves
for ratio in get_fast_shifts(SAMPLE_RATE):
# shift the audio clip
shifted = pitch_shift(audio, ratio, SAMPLE_RATE)
print(f"Pitch shift ({ratio}):", shifted)
Check out example.py to see torch_pitch_shift
a more detailed example!
Documentation
See the GitHub Wiki Page for detailed documentation!
Contributing
Please feel free to submit issues or pull requests!
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.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c76689fab1b4eee2260308a2c3583037b2ac945e5fae6c6bd327a27aae9f9e0 |
|
MD5 | 2edf2b9b6058ad091708be12d476bddf |
|
BLAKE2b-256 | 0cbcb1bb1f7d16f0df03727be4e15eb82d544d5d6ce7c4384abca5fb7552c17b |