刘悦 commited on
Commit
f2939a9
·
unverified ·
1 Parent(s): 6f6ad85

Update file_utils.py

Browse files
Files changed (1) hide show
  1. cosyvoice/utils/file_utils.py +5 -5
cosyvoice/utils/file_utils.py CHANGED
@@ -40,14 +40,14 @@ def load_wav(wav, target_sr):
40
  speech = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=target_sr)(speech)
41
  return speech
42
 
43
- def speed_change(waveform,sample_rate,speed_factor:str):
44
  effects = [
45
- ["tempo",speed_factor], # speed_factor
46
- ["rate", f"{sample_rate}"]
47
  ]
48
  augmented_waveform, new_sample_rate = torchaudio.sox_effects.apply_effects_tensor(
49
- waveform,
50
- sample_rate,
51
  effects
52
  )
53
  return augmented_waveform, new_sample_rate
 
40
  speech = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=target_sr)(speech)
41
  return speech
42
 
43
+ def speed_change(waveform, sample_rate, speed_factor: str):
44
  effects = [
45
+ ["tempo", speed_factor], # speed_factor
46
+ ["rate", f"{sample_rate}"]
47
  ]
48
  augmented_waveform, new_sample_rate = torchaudio.sox_effects.apply_effects_tensor(
49
+ waveform,
50
+ sample_rate,
51
  effects
52
  )
53
  return augmented_waveform, new_sample_rate