Spaces:
Running
Running
Commit
·
83d6d79
1
Parent(s):
0f8dcae
ninth commit
Browse files
app.py
CHANGED
@@ -169,16 +169,23 @@ def main(input, mix_coefficient):
|
|
169 |
args, our_model, device, track_audio, track_name, meter, augmented_gain
|
170 |
)
|
171 |
|
172 |
-
# if args.save_mixed_output:
|
173 |
orig_audio = int16_to_float32(orig_audio)
|
174 |
track_lufs = meter.integrated_loudness(orig_audio.T)
|
175 |
augmented_gain = args.save_output_loudnorm - track_lufs
|
176 |
orig_audio = orig_audio * db2linear(augmented_gain, eps=0.0)
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
return (
|
179 |
-
(sr, estimates
|
180 |
-
(sr, orig_audio
|
181 |
-
(sr,
|
182 |
)
|
183 |
|
184 |
|
@@ -214,12 +221,15 @@ with gr.Blocks() as demo:
|
|
214 |
btn = gr.Button("De-limit")
|
215 |
with gr.Column():
|
216 |
with gr.Box():
|
217 |
-
loud_norm_input = gr.Audio(label="Loudness Normalized Input (-14LUFS)"
|
|
|
218 |
with gr.Box():
|
219 |
-
output_audio = gr.Audio(label="De-limiter Output"
|
|
|
220 |
with gr.Box():
|
221 |
output_audio_parallel = gr.Audio(
|
222 |
-
label="Parallel Mix of the Input and its De-limiter Output"
|
|
|
223 |
)
|
224 |
slider = gr.Slider(
|
225 |
minimum=0,
|
@@ -268,16 +278,6 @@ with gr.Blocks() as demo:
|
|
268 |
],
|
269 |
outputs=plot,
|
270 |
)
|
271 |
-
|
272 |
-
# waveform_plot,
|
273 |
-
# inputs=[
|
274 |
-
# loud_norm_input,
|
275 |
-
# output_audio,
|
276 |
-
# output_audio_parallel,
|
277 |
-
# slider_plot_x,
|
278 |
-
# slider_plot_y,
|
279 |
-
# ],
|
280 |
-
# outputs=plot,
|
281 |
-
# )
|
282 |
if __name__ == "__main__":
|
283 |
demo.launch(debug=True)
|
|
|
169 |
args, our_model, device, track_audio, track_name, meter, augmented_gain
|
170 |
)
|
171 |
|
|
|
172 |
orig_audio = int16_to_float32(orig_audio)
|
173 |
track_lufs = meter.integrated_loudness(orig_audio.T)
|
174 |
augmented_gain = args.save_output_loudnorm - track_lufs
|
175 |
orig_audio = orig_audio * db2linear(augmented_gain, eps=0.0)
|
176 |
|
177 |
+
prl_mix_out = orig_audio.T * mix_coefficient + estimates.T * (1 - mix_coefficient)
|
178 |
+
prl_mix_out = prl_mix_out * 32768
|
179 |
+
prl_mix_out = prl_mix_out.astype(np.int16)
|
180 |
+
estimates = estimates.T * 32768
|
181 |
+
estimates = estimates.astype(np.int16)
|
182 |
+
orig_audio = orig_audio.T * 32768
|
183 |
+
orig_audio = orig_audio.astype(np.int16)
|
184 |
+
|
185 |
return (
|
186 |
+
(sr, estimates),
|
187 |
+
(sr, orig_audio),
|
188 |
+
(sr, prl_mix_out),
|
189 |
)
|
190 |
|
191 |
|
|
|
221 |
btn = gr.Button("De-limit")
|
222 |
with gr.Column():
|
223 |
with gr.Box():
|
224 |
+
loud_norm_input = gr.Audio(label="Loudness Normalized Input (-14LUFS)",
|
225 |
+
show_download_button=True)
|
226 |
with gr.Box():
|
227 |
+
output_audio = gr.Audio(label="De-limiter Output",
|
228 |
+
show_download_button=True,)
|
229 |
with gr.Box():
|
230 |
output_audio_parallel = gr.Audio(
|
231 |
+
label="Parallel Mix of the Input and its De-limiter Output",
|
232 |
+
show_download_button=True,
|
233 |
)
|
234 |
slider = gr.Slider(
|
235 |
minimum=0,
|
|
|
278 |
],
|
279 |
outputs=plot,
|
280 |
)
|
281 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
if __name__ == "__main__":
|
283 |
demo.launch(debug=True)
|