-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio.py
40 lines (21 loc) · 795 Bytes
/
audio.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from gtts import gTTS
from moviepy.editor import *
import os
'''
mytext = 'Shivaji Bhosale I was an Indian warrior-king and a member of the Bhonsle Maratha clan'
language = 'en'
myobj = gTTS(text=mytext, lang=language, slow=False)
myobj.save("welcome.mp3")
audio = AudioFileClip('welcome.mp3')'''
#print(audio.duration)
list=[["shivaji","adilshah"]]
default = 'C:\Users\lenovo\Documents\Django projects\bing\\'
image_clip1 = ImageClip("shivaji.jpg", duration=2)
image = '\adil.jpg'
image_clip2 = ImageClip(default + list[0][1] + image, duration=2)
imagelist=[]
imagelist.append(image_clip2)
imagelist.append(image_clip1)
result = concatenate_videoclips(imagelist, method="compose")
#result = CompositeVideoClip(imagelist)
result.write_videofile('some.mp4',fps=24)