From 663dd641378d63d8a16ab6d70a3225e12dda01f3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 23 Jul 2018 16:52:41 +0200 Subject: process --- become_yukarin/super_resolution.py | 1 - scripts/process.py | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/become_yukarin/super_resolution.py b/become_yukarin/super_resolution.py index bbba311..597ff6d 100644 --- a/become_yukarin/super_resolution.py +++ b/become_yukarin/super_resolution.py @@ -107,6 +107,5 @@ class SuperResolution(object): acoustic_feature: AcousticFeature, sampling_rate: int, ): - print('prepare 2 convert') high = self.convert(input) return self.convert_to_audio(high, acoustic_feature=acoustic_feature, sampling_rate=sampling_rate) diff --git a/scripts/process.py b/scripts/process.py index 436c8f9..d8d907a 100644 --- a/scripts/process.py +++ b/scripts/process.py @@ -71,7 +71,15 @@ def process(p: Path, acoustic_converter: AcousticConverter, super_resolution: Su converted_feature = acoustic_converter.convert_to_feature(input=input_feature, out_sampling_rate=param.voice_param.sample_rate) # converted_feature.f0 = input_feature.f0.astype(numpy.float64) - wave = super_resolution(converted_feature.spectrogram.astype(numpy.float32), acoustic_feature=converted_feature, sampling_rate=param.voice_param.sample_rate) + merged_feature = AcousticFeature( + f0=input_feature.f0, + spectrogram=converted_feature.spectrogram, + aperiodicity=converted_feature.aperiodicity, + mfcc=converted_feature.mfcc, + voiced=converted_feature.voiced, + ) + + wave = super_resolution(merged_feature.spectrogram.astype(numpy.float32), acoustic_feature=merged_feature, sampling_rate=param.voice_param.sample_rate) librosa.output.write_wav(str(output / p.stem) + '.wav', wave.wave, wave.sampling_rate, norm=True) except: -- cgit v1.2.3-70-g09d2