mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-02-07 06:02:49 +08:00
extreme value filtering
This commit is contained in:
parent
a9a77f2556
commit
cbd29350fe
@ -53,7 +53,11 @@ class PreProcess:
|
|||||||
os.makedirs(self.wavs16k_dir, exist_ok=True)
|
os.makedirs(self.wavs16k_dir, exist_ok=True)
|
||||||
|
|
||||||
def norm_write(self, tmp_audio, idx0, idx1):
|
def norm_write(self, tmp_audio, idx0, idx1):
|
||||||
tmp_audio = (tmp_audio / np.abs(tmp_audio).max() * (self.max * self.alpha)) + (
|
tmp_max=np.abs(tmp_audio).max()
|
||||||
|
if(tmp_max>2.5):
|
||||||
|
print("%s-%s-%s-filtered"%(idx0,idx1,tmp_max))
|
||||||
|
return
|
||||||
|
tmp_audio = (tmp_audio / tmp_max * (self.max * self.alpha)) + (
|
||||||
1 - self.alpha
|
1 - self.alpha
|
||||||
) * tmp_audio
|
) * tmp_audio
|
||||||
wavfile.write(
|
wavfile.write(
|
||||||
|
Loading…
Reference in New Issue
Block a user