qqwjq1981 commited on
Commit
123fe98
·
verified ·
1 Parent(s): b0e3f63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -13,8 +13,7 @@ from moviepy import (
13
  CompositeAudioClip,
14
  AudioFileClip,
15
  concatenate_videoclips,
16
- concatenate_audioclips,
17
- silence
18
  )
19
  from gtts import gTTS
20
  import subprocess
@@ -87,6 +86,12 @@ logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %
87
  logger = logging.getLogger(__name__)
88
  logger.info(f"MoviePy Version: {moviepy.__version__}")
89
 
 
 
 
 
 
 
90
  def transcribe_video(video_path):
91
  # Load the video file and extract audio
92
  video = VideoFileClip(video_path)
 
13
  CompositeAudioClip,
14
  AudioFileClip,
15
  concatenate_videoclips,
16
+ concatenate_audioclips
 
17
  )
18
  from gtts import gTTS
19
  import subprocess
 
86
  logger = logging.getLogger(__name__)
87
  logger.info(f"MoviePy Version: {moviepy.__version__}")
88
 
89
+ def silence(duration, fps=44100):
90
+ """
91
+ Returns a silent AudioClip of the specified duration.
92
+ """
93
+ return AudioFileClip(np.zeros((int(fps*duration), 2)), fps=fps)
94
+
95
  def transcribe_video(video_path):
96
  # Load the video file and extract audio
97
  video = VideoFileClip(video_path)