Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,35 @@ classifiers = [
]

dependencies = [
"bitstring>=4.0.0",
"PyYAML>=6.0",
"librosa>=0.11.0",
"matplotlib>=3.8.0",
"numpy>=1.24.0",
"pandas>=2.0.0",
"pydub>=0.25.1",
"soundfile>=0.12.0",
"torch>=2.1.0",
"torchaudio>=2.1.0",
]

[dependency-groups]
examples = [
"tqdm>=4.64.0",
]

extra = [
"Pillow>=9.0.0",
"PyWavelets>=1.3.0",
"bitstring>=4.0.0",
"matplotlib>=3.8.0",
"pandas>=2.0.0",
"praat-parselmouth>=0.4.2",
"pydub>=0.25.1",
"pyloudnorm>=0.1.1",
"pyrubberband>=0.4.0",
"PyWavelets>=1.3.0",
"PyYAML>=6.0",
"scikit-learn>=1.3.0",
"soundfile>=0.12.0",
"sox>=1.4.1",
"tabulate>=0.9.0",
"tensorboard>=2.14.0",
"torch>=2.1.0",
"torchaudio>=2.1.0",
"tqdm>=4.64.0",
]

[dependency-groups]
dev = [
"pre-commit>=4.5.0",
"ruff>=0.14.8",
Expand All @@ -67,7 +73,7 @@ Documentation = "https://github.com/resemble-ai/perth/blob/main/README.md"
"Source Code" = "https://github.com/resemble-ai/perth"

[tool.uv.build-backend]
module-root = "src"
module-root = "src"
module-name = "perth"

[project.scripts]
Expand Down
3 changes: 2 additions & 1 deletion src/perth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import numpy as np
import librosa
import soundfile as sf
import matplotlib.pyplot as plt
from typing import Tuple, Optional, Dict
from math import sqrt
from scipy.stats import mode
Expand Down Expand Up @@ -139,6 +138,8 @@ def plot_audio_comparison(
sample_rate: Sample rate of the audio
output_path: Path to save the plot. If None, plot is shown interactively.
"""
import matplotlib.pyplot as plt

fig, axs = plt.subplots(3, 1, figsize=(10, 12))

# Plot waveforms
Expand Down
5 changes: 3 additions & 2 deletions src/perth/waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from pathlib import Path
import librosa
import numpy as np
import pyrubberband as pyrb
import soundfile as sf
from audioread import NoBackendError
from pydub import AudioSegment
Expand Down Expand Up @@ -70,7 +69,9 @@ def save_wav(wav, file_or_path, sample_rate: int, subtype="PCM_16"):
sf.write(file_or_path, wav, sample_rate, subtype=subtype, format="wav")


def pitch_shift(wav, sample_rate, semitones):
def pitch_shift(wav, sample_rate, semitones): # TODO: unused function?
import pyrubberband as pyrb

return pyrb.pitch_shift(wav, sample_rate, semitones)


Expand Down
60 changes: 33 additions & 27 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.