Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -106,7 +106,9 @@ def get_music(prompt):
|
|
106 |
|
107 |
def merge_video(music, img_list):
|
108 |
#Convert to mp3
|
109 |
-
|
|
|
|
|
110 |
print('wav audio converted to mp3 audio' )
|
111 |
print('now getting duration of this mp3 audio' )
|
112 |
#getting audio clip's duration
|
@@ -137,7 +139,7 @@ def merge_video(music, img_list):
|
|
137 |
print('loading video-clip')
|
138 |
|
139 |
# loading audio file
|
140 |
-
audioclip = AudioFileClip(
|
141 |
print('loading mp3-format audio')
|
142 |
# adding audio to the video clip
|
143 |
mergedclip = videoclip.set_audio(audioclip)
|
|
|
106 |
|
107 |
def merge_video(music, img_list):
|
108 |
#Convert to mp3
|
109 |
+
mp3file_name = "audio.mp3"
|
110 |
+
wavfile = AudioSegment.from_wav(music)
|
111 |
+
wavfile.export(mp3file_name, format="mp3")
|
112 |
print('wav audio converted to mp3 audio' )
|
113 |
print('now getting duration of this mp3 audio' )
|
114 |
#getting audio clip's duration
|
|
|
139 |
print('loading video-clip')
|
140 |
|
141 |
# loading audio file
|
142 |
+
audioclip = AudioFileClip(mp3file_name) #.subclip(0, 15)
|
143 |
print('loading mp3-format audio')
|
144 |
# adding audio to the video clip
|
145 |
mergedclip = videoclip.set_audio(audioclip)
|