kevinwang676 commited on
Commit
52d6024
1 Parent(s): 7fde70a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -223,12 +223,12 @@ def merge_audios(folder_path):
223
  return "AI配音版.wav"
224
 
225
  import shutil
226
- from scipy.io import wavfile
227
 
228
  def convert_from_srt(apikey, filename, audio_full, voice, multilingual):
229
  subtitle_list = read_srt(filename)
230
- samplerate, data = wavfile.read(audio_full)
231
- wavfile.write("audio_full.wav", samplerate, data.astype(np.int16))
 
232
 
233
  if os.path.isdir("output"):
234
  shutil.rmtree("output")
 
223
  return "AI配音版.wav"
224
 
225
  import shutil
 
226
 
227
  def convert_from_srt(apikey, filename, audio_full, voice, multilingual):
228
  subtitle_list = read_srt(filename)
229
+ audio_data, sr = librosa.load(audio_full, sr=16000, mono=True)
230
+
231
+ write("audio_full.wav", sr, audio_data.astype(np.int16))
232
 
233
  if os.path.isdir("output"):
234
  shutil.rmtree("output")