Spaces:
Build error
Build error
Remove input audio limiter
Browse files
app.py
CHANGED
|
@@ -108,16 +108,20 @@ def demo_fn(speech_upl: str, noise_type: str, snr: int, mic_input: Optional[str]
|
|
| 108 |
snr = int(snr)
|
| 109 |
noise_fn = NOISES[noise_type]
|
| 110 |
meta = AudioMetaData(-1, -1, -1, -1, "")
|
| 111 |
-
|
|
|
|
|
|
|
| 112 |
if speech_upl is not None:
|
| 113 |
sample, meta = load_audio(speech_upl, sr)
|
| 114 |
-
max_len = max_s * sr
|
| 115 |
-
if sample.shape[-1] > max_len:
|
| 116 |
-
|
| 117 |
-
|
| 118 |
else:
|
| 119 |
sample, meta = load_audio("samples/p232_013_clean.wav", sr)
|
| 120 |
-
sample = sample[..., : max_s * sr]
|
|
|
|
|
|
|
| 121 |
if sample.dim() > 1 and sample.shape[0] > 1:
|
| 122 |
assert (
|
| 123 |
sample.shape[1] > sample.shape[0]
|
|
|
|
| 108 |
snr = int(snr)
|
| 109 |
noise_fn = NOISES[noise_type]
|
| 110 |
meta = AudioMetaData(-1, -1, -1, -1, "")
|
| 111 |
+
# --------------------vvv CHANGES START HERE vvv--------------------
|
| 112 |
+
# max_s = 10 # limit to 10 seconds # <--- COMMENT OUT OR DELETE THIS LINE
|
| 113 |
+
|
| 114 |
if speech_upl is not None:
|
| 115 |
sample, meta = load_audio(speech_upl, sr)
|
| 116 |
+
# max_len = max_s * sr # <--- COMMENT OUT OR DELETE THIS LINE
|
| 117 |
+
# if sample.shape[-1] > max_len: # <--- COMMENT OUT OR DELETE THIS LINE
|
| 118 |
+
# start = torch.randint(0, sample.shape[-1] - max_len, ()).item() # <--- COMMENT OUT OR DELETE
|
| 119 |
+
# sample = sample[..., start : start + max_len] # <--- COMMENT OUT OR DELETE
|
| 120 |
else:
|
| 121 |
sample, meta = load_audio("samples/p232_013_clean.wav", sr)
|
| 122 |
+
# sample = sample[..., : max_s * sr] # <--- COMMENT OUT OR DELETE THIS LINE
|
| 123 |
+
# --------------------^^^ CHANGES END HERE ^^^--------------------
|
| 124 |
+
|
| 125 |
if sample.dim() > 1 and sample.shape[0] > 1:
|
| 126 |
assert (
|
| 127 |
sample.shape[1] > sample.shape[0]
|