Skip to content

Commit 461e8fa

Browse files
committed
fix license issue
1 parent 1175720 commit 461e8fa

File tree

3 files changed

+14
-38
lines changed

3 files changed

+14
-38
lines changed

lib/rvc/pipeline.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import faiss
66
import numpy as np
7-
import parselmouth
87
import pyworld
98
import scipy.signal as signal
109
import torch
@@ -67,23 +66,8 @@ def get_f0(
6766
f0_max = 1100
6867
f0_mel_min = 1127 * np.log(1 + f0_min / 700)
6968
f0_mel_max = 1127 * np.log(1 + f0_max / 700)
70-
if f0_method == "pm":
71-
f0 = (
72-
parselmouth.Sound(x, self.sr)
73-
.to_pitch_ac(
74-
time_step=time_step / 1000,
75-
voicing_threshold=0.6,
76-
pitch_floor=f0_min,
77-
pitch_ceiling=f0_max,
78-
)
79-
.selected_array["frequency"]
80-
)
81-
pad_size = (p_len - len(f0) + 1) // 2
82-
if pad_size > 0 or p_len - len(f0) - pad_size > 0:
83-
f0 = np.pad(
84-
f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant"
85-
)
86-
elif f0_method == "harvest":
69+
70+
if f0_method == "harvest":
8771
f0, t = pyworld.harvest(
8872
x.astype(np.double),
8973
fs=self.sr,
@@ -93,6 +77,17 @@ def get_f0(
9377
)
9478
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.sr)
9579
f0 = signal.medfilt(f0, 3)
80+
elif f0_method == "dio":
81+
f0, t = pyworld.dio(
82+
x.astype(np.double),
83+
fs=self.sr,
84+
f0_ceil=f0_max,
85+
f0_floor=f0_min,
86+
frame_period=10,
87+
)
88+
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.sr)
89+
f0 = signal.medfilt(f0, 3)
90+
9691
f0 *= pow(2, f0_up_key / 12)
9792
tf0 = self.sr // self.window # f0 points per second
9893
if inp_f0 is not None:

lib/rvc/preprocessing/extract_f0.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from typing import *
55

66
import numpy as np
7-
import parselmouth
87
import pyworld
98
from tqdm import tqdm
109

@@ -21,24 +20,7 @@ def compute_f0(
2120
):
2221
x = load_audio(path, fs)
2322
p_len = x.shape[0] // hop
24-
if f0_method == "pm":
25-
time_step = 160 / 16000 * 1000
26-
f0_max = 1100
27-
f0_min = 50
28-
f0 = (
29-
parselmouth.Sound(x, fs)
30-
.to_pitch_ac(
31-
time_step=time_step / 1000,
32-
voicing_threshold=0.6,
33-
pitch_floor=f0_min,
34-
pitch_ceiling=f0_max,
35-
)
36-
.selected_array["frequency"]
37-
)
38-
pad_size = (p_len - len(f0) + 1) // 2
39-
if pad_size > 0 or p_len - len(f0) - pad_size > 0:
40-
f0 = np.pad(f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant")
41-
elif f0_method == "harvest":
23+
if f0_method == "harvest":
4224
f0, t = pyworld.harvest(
4325
x.astype(np.double),
4426
fs=fs,

requirements/main.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ fairseq==0.12.2
66
matplotlib==3.7.1
77
scipy==1.9.3
88
librosa==0.9.2
9-
praat-parselmouth==0.4.3
109
pyworld==0.3.2
1110
soundfile==0.12.1
1211
ffmpeg-python==0.2.0

0 commit comments

Comments
 (0)