-
-
Save r9y9/cd27653e4c19c51add65c44439cc0a98 to your computer and use it in GitHub Desktop.
Use https://github.com/bjbschmitt/AMFM_decompy in nnsvs. https://github.com/r9y9/nnsvs/blob/9be701e0b3603d332247430ea7e5c6c515763aaa/nnsvs/data/data_source.py#L143-L149
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if self.use_harvest: | |
import amfm_decompy.pYAAPT as pYAAPT | |
import amfm_decompy.basic_tools as basic | |
signal = basic.SignalObj(wav_path) | |
print(min_f0, max_f0) | |
min_f0 = min(150, min_f0) # TODO: Fix this property | |
pitch = pYAAPT.yaapt(signal, f0_min=min_f0, f0_max=max_f0, frame_length=25, frame_space=5) | |
f0 = pitch.samp_values.astype(np.float64) | |
timeaxis = np.linspace(0, (pitch.samp_values.shape[0]-1) * 0.005, len(pitch.samp_values)) | |
#f0, timeaxis = pyworld.harvest(x, fs, frame_period=self.frame_period, | |
#f0_floor=min_f0, f0_ceil=max_f0) | |
else: | |
f0, timeaxis = pyworld.dio(x, fs, frame_period=self.frame_period, | |
f0_floor=min_f0, f0_ceil=max_f0) | |
f0 = pyworld.stonemask(x, f0, timeaxis, fs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment