Skip to content

Commit

Permalink
Merge pull request #928 from IAHispano/formatter/main
Browse files Browse the repository at this point in the history
chore(format): run black on main
  • Loading branch information
blaisewf authored Dec 27, 2024
2 parents f76e38f + d91ca14 commit 195b24e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rvc/lib/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import os
import sys
import soxr
import librosa
Expand Down Expand Up @@ -41,7 +41,9 @@ def load_audio(file, sample_rate):
if len(audio.shape) > 1:
audio = librosa.to_mono(audio.T)
if sr != sample_rate:
audio = librosa.resample(audio, orig_sr=sr, target_sr=sample_rate, res_type="soxr_vhq")
audio = librosa.resample(
audio, orig_sr=sr, target_sr=sample_rate, res_type="soxr_vhq"
)
except Exception as error:
raise RuntimeError(f"An error occurred loading the audio: {error}")

Expand All @@ -62,7 +64,9 @@ def load_audio_infer(
if len(audio.shape) > 1:
audio = librosa.to_mono(audio.T)
if sr != sample_rate:
audio = librosa.resample(audio, orig_sr=sr, target_sr=sample_rate, res_type="soxr_vhq")
audio = librosa.resample(
audio, orig_sr=sr, target_sr=sample_rate, res_type="soxr_vhq"
)
if formant_shifting:
formant_qfrency = kwargs.get("formant_qfrency", 0.8)
formant_timbre = kwargs.get("formant_timbre", 0.8)
Expand Down

0 comments on commit 195b24e

Please sign in to comment.