Update app.py
Browse files
app.py
CHANGED
@@ -52,15 +52,21 @@ def combine_audio_with_time(target_audio, mixed_audio):
|
|
52 |
print(f"目标音频文件路径: {target_audio}")
|
53 |
print(f"混合音频文件路径: {mixed_audio}")
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
# 加载目标说话人的样本音频
|
56 |
try:
|
57 |
-
target_audio_segment =
|
58 |
except Exception as e:
|
59 |
return f"加载目标音频时出错: {e}"
|
60 |
|
61 |
# 加载混合音频
|
62 |
try:
|
63 |
-
mixed_audio_segment =
|
64 |
except Exception as e:
|
65 |
return f"加载混合音频时出错: {e}"
|
66 |
|
|
|
52 |
print(f"目标音频文件路径: {target_audio}")
|
53 |
print(f"混合音频文件路径: {mixed_audio}")
|
54 |
|
55 |
+
target_audio = convert_to_wav(target_audio)
|
56 |
+
mixed_audio = convert_to_wav(mixed_audio)
|
57 |
+
|
58 |
+
print(f"目标音频文件路径: {target_audio}")
|
59 |
+
print(f"混合音频文件路径: {mixed_audio}")
|
60 |
+
|
61 |
# 加载目标说话人的样本音频
|
62 |
try:
|
63 |
+
target_audio_segment = AudioSegment.from_wav(target_audio)
|
64 |
except Exception as e:
|
65 |
return f"加载目标音频时出错: {e}"
|
66 |
|
67 |
# 加载混合音频
|
68 |
try:
|
69 |
+
mixed_audio_segment = AudioSegment.from_wav(mixed_audio)
|
70 |
except Exception as e:
|
71 |
return f"加载混合音频时出错: {e}"
|
72 |
|