Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -89,7 +89,7 @@ def generate_audio(text,
|
|
89 |
|
90 |
original_length = len(gt)
|
91 |
# Ensure the audio is of the correct length by padding or trimming
|
92 |
-
duration_seconds = len(gt) / sr
|
93 |
quantized_duration = np.ceil(duration_seconds * 2) / 2 # This rounds to the nearest 0.5 seconds
|
94 |
num_samples = int(quantized_duration * sr)
|
95 |
audio_frames = round(num_samples / sr * params['autoencoder']['latent_sr'])
|
|
|
89 |
|
90 |
original_length = len(gt)
|
91 |
# Ensure the audio is of the correct length by padding or trimming
|
92 |
+
duration_seconds = min(len(gt) / sr, 10)
|
93 |
quantized_duration = np.ceil(duration_seconds * 2) / 2 # This rounds to the nearest 0.5 seconds
|
94 |
num_samples = int(quantized_duration * sr)
|
95 |
audio_frames = round(num_samples / sr * params['autoencoder']['latent_sr'])
|