DmitryRyumin commited on
Commit
7a4a029
Β·
1 Parent(s): 49ec65c

Update submit.py

Browse files
Files changed (1) hide show
  1. app/event_handlers/submit.py +5 -0
app/event_handlers/submit.py CHANGED
@@ -20,6 +20,7 @@ from app.utils import (
20
  find_intersections,
21
  calculate_mode,
22
  find_nearest_frames,
 
23
  )
24
  from app.plots import (
25
  get_evenly_spaced_frame_indices,
@@ -45,6 +46,10 @@ from app.components import html_message
45
  def event_handler_submit(
46
  video: str,
47
  ) -> tuple[gr.HTML, gr.Plot, gr.Plot, gr.Plot, gr.Plot]:
 
 
 
 
48
  audio_file_path = convert_video_to_audio(file_path=video, sr=config_data.General_SR)
49
  wav, vad_info = readetect_speech(
50
  file_path=audio_file_path,
 
20
  find_intersections,
21
  calculate_mode,
22
  find_nearest_frames,
23
+ convert_webm_to_mp4,
24
  )
25
  from app.plots import (
26
  get_evenly_spaced_frame_indices,
 
46
  def event_handler_submit(
47
  video: str,
48
  ) -> tuple[gr.HTML, gr.Plot, gr.Plot, gr.Plot, gr.Plot]:
49
+ if video:
50
+ if video.split(".")[-1] == "webm":
51
+ video = convert_webm_to_mp4(video)
52
+
53
  audio_file_path = convert_video_to_audio(file_path=video, sr=config_data.General_SR)
54
  wav, vad_info = readetect_speech(
55
  file_path=audio_file_path,