Politrees commited on
Commit
fc5053d
Β·
verified Β·
1 Parent(s): 5d5514b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -8,6 +8,10 @@ from pydub import AudioSegment
8
  from moviepy import VideoFileClip
9
 
10
 
 
 
 
 
11
  # ---------- AUDIO PROCESSING ----------
12
  def convert_audio(input_files, output_format, session_id, merge_files, gap_duration):
13
  """Converts or merges a list of audio files."""
@@ -119,20 +123,15 @@ def update_format_choices(conversion_type):
119
  return gr.Dropdown(choices=audio_formats, value="mp3", label="Output Audio Format")
120
 
121
 
122
- audio_formats = ["mp3", "wav", "flac", "ogg", "aac", "m4a", "aiff", "wma", "opus"]
123
- video_formats = ["mp4", "webm", "mkv", "avi", "mov", "flv"]
124
-
125
-
126
  # ---------- UI ----------
127
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
128
- gr.Markdown("# Universal Media Converter 🎧🎬")
129
- gr.Markdown("Use the tabs below to switch between the Audio and Video converters.")
130
 
131
  with gr.Tabs():
132
  # AUDIO TAB
133
  with gr.TabItem("🎢 Audio Converter"):
134
- gr.Markdown("## Convert and Merge Audio Files")
135
- gr.Markdown("Upload one or more audio files and select the output format. You can also merge all files into a single track.")
136
 
137
  with gr.Row():
138
  with gr.Column(scale=2):
@@ -153,8 +152,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
153
 
154
  # VIDEO TAB
155
  with gr.TabItem("🎬 Video Converter"):
156
- gr.Markdown("## Convert Video and Extract Audio")
157
- gr.Markdown("Upload a video file, then choose whether to convert it to another video format or to extract its audio track.")
158
 
159
  with gr.Row():
160
  with gr.Column(scale=2):
 
8
  from moviepy import VideoFileClip
9
 
10
 
11
+ audio_formats = ["mp3", "wav", "flac", "ogg", "aac", "m4a", "aiff", "wma", "opus"]
12
+ video_formats = ["mp4", "webm", "mkv", "avi", "mov", "flv"]
13
+
14
+
15
  # ---------- AUDIO PROCESSING ----------
16
  def convert_audio(input_files, output_format, session_id, merge_files, gap_duration):
17
  """Converts or merges a list of audio files."""
 
123
  return gr.Dropdown(choices=audio_formats, value="mp3", label="Output Audio Format")
124
 
125
 
 
 
 
 
126
  # ---------- UI ----------
127
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
128
+ gr.HTML("<center><h1>Universal Media Converter 🎧🎬</h1></center>")
 
129
 
130
  with gr.Tabs():
131
  # AUDIO TAB
132
  with gr.TabItem("🎢 Audio Converter"):
133
+ gr.HTML("<center><h2>Convert and Merge Audio Files</h2></center>")
134
+ gr.HTML("<center>Upload one or more audio files and select the output format. You can also merge all files into a single track.</center>")
135
 
136
  with gr.Row():
137
  with gr.Column(scale=2):
 
152
 
153
  # VIDEO TAB
154
  with gr.TabItem("🎬 Video Converter"):
155
+ gr.HTML("<center><h2>Convert Video and Extract Audio</h2></center>")
156
+ gr.HTML("<center>Upload a video file, then choose whether to convert it to another video format or to extract its audio track.</center>")
157
 
158
  with gr.Row():
159
  with gr.Column(scale=2):