Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -223,13 +223,14 @@ def merge_audios(folder_path):
|
|
| 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 |
|
| 230 |
#audio_data, sr = torchaudio.load(audio_full)
|
| 231 |
-
audio_data, sr = librosa.load(audio_full, sr=44100)
|
| 232 |
-
|
| 233 |
write("audio_full.wav", sr, audio_data.astype(np.int16))
|
| 234 |
|
| 235 |
if os.path.isdir("output"):
|
|
|
|
| 223 |
return "AI配音版.wav"
|
| 224 |
|
| 225 |
import shutil
|
| 226 |
+
from pathlib import Path
|
| 227 |
|
| 228 |
def convert_from_srt(apikey, filename, audio_full, voice, multilingual):
|
| 229 |
subtitle_list = read_srt(filename)
|
| 230 |
|
| 231 |
#audio_data, sr = torchaudio.load(audio_full)
|
| 232 |
+
audio_data, sr = librosa.load((str(Path(audio_full))), sr=44100)
|
| 233 |
+
|
| 234 |
write("audio_full.wav", sr, audio_data.astype(np.int16))
|
| 235 |
|
| 236 |
if os.path.isdir("output"):
|