ysharma HF staff commited on
Commit
7838680
·
1 Parent(s): 392f66a
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -8,7 +8,7 @@ from pydub import AudioSegment
8
  from moviepy.editor import *
9
  import numpy as np
10
  import mutagen
11
- from mutagen.wave import WAVE
12
 
13
  #path = "/content/gdrive/My Drive/AI/sample_imgs/"
14
  #dirs = os.listdir( path )
@@ -45,6 +45,7 @@ def resize(img_list):
45
  # return clip
46
  #clip.write_videofile('/content/gdrive/My Drive/AI/my_vid_20apr.mp4')
47
 
 
48
 
49
  def merge_audio_video(entities_num, resize_img_list, text_input):
50
  print("** inside merge aud vid **")
@@ -63,7 +64,7 @@ def merge_audio_video(entities_num, resize_img_list, text_input):
63
  print('flac audio converted to mp3 audio' )
64
  print('now getting duration of this mp3 audio' )
65
  #getting audio clip's duration
66
- audio_length = int(WAVE("audio.mp3").info.length)
67
 
68
  #Calculate the desired frame per second based on given audio length and entities identified
69
  fps= entities_num / audio_length #19 #length of audio file #13 / 19
 
8
  from moviepy.editor import *
9
  import numpy as np
10
  import mutagen
11
+ from mutagen.mp3 import MP3
12
 
13
  #path = "/content/gdrive/My Drive/AI/sample_imgs/"
14
  #dirs = os.listdir( path )
 
45
  # return clip
46
  #clip.write_videofile('/content/gdrive/My Drive/AI/my_vid_20apr.mp4')
47
 
48
+ #gradio.inputs.Audio(self, source="upload", type="numpy", label=None, optional=False)
49
 
50
  def merge_audio_video(entities_num, resize_img_list, text_input):
51
  print("** inside merge aud vid **")
 
64
  print('flac audio converted to mp3 audio' )
65
  print('now getting duration of this mp3 audio' )
66
  #getting audio clip's duration
67
+ audio_length = int(MP3("audio.mp3").info.length)
68
 
69
  #Calculate the desired frame per second based on given audio length and entities identified
70
  fps= entities_num / audio_length #19 #length of audio file #13 / 19