Merge branch 'remove-restriction' into 'main'
Browse filesRemove audio duration validation logic and update dependency specification
See merge request sonne-technology/bsod-tv/waveform-matching-gradio-front-end!19
- app.py +1 -20
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -7,10 +7,8 @@
|
|
| 7 |
|
| 8 |
import os
|
| 9 |
import time
|
| 10 |
-
import wave
|
| 11 |
import modal
|
| 12 |
import logging
|
| 13 |
-
import contextlib
|
| 14 |
import gradio as gr
|
| 15 |
|
| 16 |
logging.basicConfig(level=logging.DEBUG)
|
|
@@ -28,23 +26,6 @@ def process_audio(original_audio_path, dubbed_audio_path, email, company_name, t
|
|
| 28 |
modal_environment = os.environ['MODAL_ENVIRONMENT']
|
| 29 |
modal_volume = os.environ['MODAL_VOLUME']
|
| 30 |
processing_id = str(int(time.time()))
|
| 31 |
-
try:
|
| 32 |
-
with contextlib.closing(wave.open(original_audio_path, 'r')) as f:
|
| 33 |
-
frames = f.getnframes()
|
| 34 |
-
rate = f.getframerate()
|
| 35 |
-
original_duration = frames / float(rate)
|
| 36 |
-
|
| 37 |
-
with contextlib.closing(wave.open(dubbed_audio_path, 'r')) as f:
|
| 38 |
-
frames = f.getnframes()
|
| 39 |
-
rate = f.getframerate()
|
| 40 |
-
dubbed_duration = frames / float(rate)
|
| 41 |
-
|
| 42 |
-
if original_duration > 1800 or dubbed_duration > 1800:
|
| 43 |
-
return "Error: Audio duration exceeds 30 minutes."
|
| 44 |
-
|
| 45 |
-
except Exception as e:
|
| 46 |
-
return f"Error reading audio files: {e}"
|
| 47 |
-
# 2. Upload Audio Files to Modal Storage
|
| 48 |
try:
|
| 49 |
bsodtv_storage = modal.Volume.from_name(modal_volume)
|
| 50 |
with bsodtv_storage.batch_upload() as batch:
|
|
@@ -267,7 +248,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(primary_hue="indigo", secondary_hue
|
|
| 267 |
<h1 style="margin-top: 0;">BSOD.tv - Dub QC Demo</h1>
|
| 268 |
<p style="font-size: 1.1rem; line-height: 1.618;">
|
| 269 |
Professional audio synchronization verification for media localization.
|
| 270 |
-
<br>Upload original and dubbed .wav files
|
| 271 |
</p>
|
| 272 |
""")
|
| 273 |
|
|
|
|
| 7 |
|
| 8 |
import os
|
| 9 |
import time
|
|
|
|
| 10 |
import modal
|
| 11 |
import logging
|
|
|
|
| 12 |
import gradio as gr
|
| 13 |
|
| 14 |
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
| 26 |
modal_environment = os.environ['MODAL_ENVIRONMENT']
|
| 27 |
modal_volume = os.environ['MODAL_VOLUME']
|
| 28 |
processing_id = str(int(time.time()))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
try:
|
| 30 |
bsodtv_storage = modal.Volume.from_name(modal_volume)
|
| 31 |
with bsodtv_storage.batch_upload() as batch:
|
|
|
|
| 248 |
<h1 style="margin-top: 0;">BSOD.tv - Dub QC Demo</h1>
|
| 249 |
<p style="font-size: 1.1rem; line-height: 1.618;">
|
| 250 |
Professional audio synchronization verification for media localization.
|
| 251 |
+
<br>Upload original and dubbed .wav files to start the QC process.
|
| 252 |
</p>
|
| 253 |
""")
|
| 254 |
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
modal
|
| 2 |
gradio
|
|
|
|
| 1 |
+
modal
|
| 2 |
gradio
|