kevinwang676 commited on
Commit
c90210a
·
1 Parent(s): 5861cfb

Update utils/tools.py

Browse files
Files changed (1) hide show
  1. utils/tools.py +2 -4
utils/tools.py CHANGED
@@ -44,9 +44,7 @@ def load_wav(wav_path, sr=None):
44
 
45
  """
46
  wav, fs = sf.read(wav_path)
47
- if wav.ndim != 1:
48
- print('The wav file %s has %d channels, select the first one to proceed.' %(wav_path, wav.ndim))
49
- wav = wav[:,0]
50
  assert sr is None or fs == sr, f'{sr} kHz audio is required. Got {fs}'
51
  peak = np.abs(wav).max()
52
  if peak > 1.0:
@@ -168,4 +166,4 @@ def load_checkpoint(model, optimizer, scheduler, checkpoint_path, load_only_para
168
  steps = state_dict["steps"]
169
  epochs = state_dict["epochs"]
170
 
171
- return steps, epochs
 
44
 
45
  """
46
  wav, fs = sf.read(wav_path)
47
+ assert wav.ndim == 1, 'Single-channel audio is required.'
 
 
48
  assert sr is None or fs == sr, f'{sr} kHz audio is required. Got {fs}'
49
  peak = np.abs(wav).max()
50
  if peak > 1.0:
 
166
  steps = state_dict["steps"]
167
  epochs = state_dict["epochs"]
168
 
169
+ return steps, epochs