liqian 2 gadi atpakaļ
vecāks
revīzija
c4ecbf524d
2 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 1 1
      app.py
  2. 2 1
      audio_process.py

+ 1 - 1
app.py

@@ -258,7 +258,7 @@ def title_generate_main():
                         continue
                 if title is None:
                     continue
-                elif title[0] in ['"', "'"] and title[-1] in ['"', "'"]:
+                elif title[0] in ['"', "'", "′", "“"] and title[-1] in ['"', "'", "′", "“"]:
                     title = title[1:-1]
                 log_.info({'titleGenerate': {'videoId': video_id, 'title': title}})
 

+ 2 - 1
audio_process.py

@@ -6,7 +6,8 @@ config_ = set_config()
 
 def get_wav(video_path):
     """提取音频"""
-    video = VideoFileClip(video_path)
+    # 音频采样率设置为:8K
+    video = VideoFileClip(video_path, audio_fps=8000)
     # Extract the audio from the video
     audio = video.audio
     # Save the extracted audio to a file