j commited on
Commit
b634a74
1 Parent(s): 037a3b0

account for sample rate & last segment producing an integer offset into base audio file

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,7 +35,7 @@ def process_fn(input_audio_path, seed, guidance_scale, num_inference_steps):
35
  output_audio_path (str): the filepath of the processed audio.
36
  """
37
 
38
- sig = AudioSignal(input_audio_path)
39
 
40
  outfile = "./output.wav"
41
 
@@ -54,7 +54,7 @@ def process_fn(input_audio_path, seed, guidance_scale, num_inference_steps):
54
  end = start + 10
55
 
56
  # get segment of audio from original file
57
- sig_seg = sig[start:end]
58
  sig_seg.write("temp.wav")
59
  audio = super_resolution(
60
  audiosr,
 
35
  output_audio_path (str): the filepath of the processed audio.
36
  """
37
 
38
+ sig = AudioSignal(input_audio_path, sample_rate=48000)
39
 
40
  outfile = "./output.wav"
41
 
 
54
  end = start + 10
55
 
56
  # get segment of audio from original file
57
+ sig_seg = sig[start*sig.sample_rate:int(end*sig.sample_rate)] # int accounts for float end time on last seg
58
  sig_seg.write("temp.wav")
59
  audio = super_resolution(
60
  audiosr,