azamat commited on
Commit
4f821f0
1 Parent(s): 96c45a5
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -1,8 +1,8 @@
1
- import os
2
  import json
3
  from tqdm import tqdm
4
  from copy import deepcopy
5
 
 
6
  import numpy as np
7
  import gradio as gr
8
  import torch
@@ -12,8 +12,6 @@ random.seed(0)
12
  torch.manual_seed(0)
13
  np.random.seed(0)
14
 
15
- from scipy.io.wavfile import write as wavwrite
16
-
17
  from util import print_size, sampling
18
  from network import CleanUNet
19
  import torchaudio
@@ -82,7 +80,7 @@ def denoise(filename, ckpt_path = CHECKPOINT):
82
 
83
  all_audio = np.concatenate(all_audio, axis=0)
84
  print("saved to:", new_file_name)
85
- wavwrite(new_file_name, 32000, all_audio.squeeze())
86
 
87
  return new_file_name
88
 
 
 
1
  import json
2
  from tqdm import tqdm
3
  from copy import deepcopy
4
 
5
+ import soundfile as sf
6
  import numpy as np
7
  import gradio as gr
8
  import torch
 
12
  torch.manual_seed(0)
13
  np.random.seed(0)
14
 
 
 
15
  from util import print_size, sampling
16
  from network import CleanUNet
17
  import torchaudio
 
80
 
81
  all_audio = np.concatenate(all_audio, axis=0)
82
  print("saved to:", new_file_name)
83
+ sf.write(new_file_name, all_audio.squeeze(), 32000)
84
 
85
  return new_file_name
86