qqwjq1981 commited on
Commit
7e6d11d
·
verified ·
1 Parent(s): 83b77eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -16,6 +16,7 @@ from moviepy import (
16
  concatenate_videoclips,
17
  concatenate_audioclips
18
  )
 
19
  from gtts import gTTS
20
  import subprocess
21
  import speech_recognition as sr
@@ -27,6 +28,12 @@ import whisper
27
  import time
28
  import sqlite3
29
 
 
 
 
 
 
 
30
  # Define the passcode
31
  PASSCODE = "show_feedback_db"
32
 
@@ -87,12 +94,6 @@ 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 silence(duration, fps=44100):
91
- """
92
- Returns a silent AudioClip of the specified duration.
93
- """
94
- return AudioFileClip(np.zeros((int(fps*duration), 2)), fps=fps)
95
-
96
  def transcribe_video(video_path):
97
  # Load the video file and extract audio
98
  video = VideoFileClip(video_path)
 
16
  concatenate_videoclips,
17
  concatenate_audioclips
18
  )
19
+ from moviepy.audio.AudioClip import AudioArrayClip
20
  from gtts import gTTS
21
  import subprocess
22
  import speech_recognition as sr
 
28
  import time
29
  import sqlite3
30
 
31
+ def silence(duration, fps=44100):
32
+ """
33
+ Returns a silent AudioClip of the specified duration.
34
+ """
35
+ return AudioArrayClip(np.zeros((int(fps*duration), 2)), fps=fps)
36
+
37
  # Define the passcode
38
  PASSCODE = "show_feedback_db"
39
 
 
94
  logger = logging.getLogger(__name__)
95
  logger.info(f"MoviePy Version: {moviepy.__version__}")
96
 
 
 
 
 
 
 
97
  def transcribe_video(video_path):
98
  # Load the video file and extract audio
99
  video = VideoFileClip(video_path)