Spaces:
Runtime error
Runtime error
j
commited on
Commit
·
e72db6a
1
Parent(s):
26d036d
added a bunch of debug output, segment timing/writing errors
Browse files
app.py
CHANGED
|
@@ -42,8 +42,11 @@ def process_fn(input_audio_path, seed, guidance_scale, num_inference_steps):
|
|
| 42 |
audio_concat = None
|
| 43 |
|
| 44 |
total_length = sig.duration
|
|
|
|
| 45 |
num_segs = int(total_length / 5.12) # 5.12 second segments
|
|
|
|
| 46 |
remainder = total_length % 5.12 # duration of last segment
|
|
|
|
| 47 |
|
| 48 |
for audio_segment in range(num_segs):
|
| 49 |
print(f"Processing segment {audio_segment} of {num_segs}")
|
|
@@ -56,6 +59,11 @@ def process_fn(input_audio_path, seed, guidance_scale, num_inference_steps):
|
|
| 56 |
|
| 57 |
# get segment of audio from original file
|
| 58 |
sig_seg = sig[int(start*sig.sample_rate):int(end*sig.sample_rate)] # int accounts for float end time on last seg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
sig_seg.write("temp.wav")
|
| 60 |
audio = super_resolution(
|
| 61 |
audiosr,
|
|
|
|
| 42 |
audio_concat = None
|
| 43 |
|
| 44 |
total_length = sig.duration
|
| 45 |
+
print(f"Total length: {total_length}")
|
| 46 |
num_segs = int(total_length / 5.12) # 5.12 second segments
|
| 47 |
+
print(f"Number of segments: {num_segs}")
|
| 48 |
remainder = total_length % 5.12 # duration of last segment
|
| 49 |
+
print(f"Remainder: {remainder}")
|
| 50 |
|
| 51 |
for audio_segment in range(num_segs):
|
| 52 |
print(f"Processing segment {audio_segment} of {num_segs}")
|
|
|
|
| 59 |
|
| 60 |
# get segment of audio from original file
|
| 61 |
sig_seg = sig[int(start*sig.sample_rate):int(end*sig.sample_rate)] # int accounts for float end time on last seg
|
| 62 |
+
print(f"Segment length: {sig_seg.duration}")
|
| 63 |
+
print(f"Segment start: {start}")
|
| 64 |
+
print(f"Segment end: {end}")
|
| 65 |
+
print(f"Segment start sample: {int(start*sig.sample_rate)}")
|
| 66 |
+
print(f"Segment end sample: {int(end*sig.sample_rate)}")
|
| 67 |
sig_seg.write("temp.wav")
|
| 68 |
audio = super_resolution(
|
| 69 |
audiosr,
|