Spaces:
Runtime error
Runtime error
Katock
commited on
Commit
·
6ead1f4
1
Parent(s):
9e75f13
debug
Browse files- app.py +7 -7
- models/carl/cover.png +0 -0
- models/cesar/cover.png +0 -0
- models/tenpenny/cover.png +0 -0
- models/tommy/cover.png +0 -0
- models/wuzimu/cover.png +0 -0
app.py
CHANGED
|
@@ -38,13 +38,13 @@ def create_vc_fn(model, spk):
|
|
| 38 |
if duration > 20 and limitation:
|
| 39 |
return "请上传小于20秒的音频,或点击右上角裁剪", None
|
| 40 |
print("audio1: ", audio)
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
|
| 49 |
# raw_path = io.BytesIO()
|
| 50 |
# soundfile.write(raw_path, audio, sampling_rate, format="wav")
|
|
|
|
| 38 |
if duration > 20 and limitation:
|
| 39 |
return "请上传小于20秒的音频,或点击右上角裁剪", None
|
| 40 |
print("audio1: ", audio)
|
| 41 |
+
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
| 42 |
+
if len(audio.shape) > 1:
|
| 43 |
+
audio = librosa.to_mono(audio.transpose(1, 0))
|
| 44 |
+
if sampling_rate != 16000:
|
| 45 |
+
audio = librosa.resample(audio, orig_sr=sampling_rate, target_sr=16000)
|
| 46 |
+
print("audio2: ", audio)
|
| 47 |
+
input_audio = sampling_rate, audio
|
| 48 |
|
| 49 |
# raw_path = io.BytesIO()
|
| 50 |
# soundfile.write(raw_path, audio, sampling_rate, format="wav")
|
models/carl/cover.png
CHANGED
|
|
models/cesar/cover.png
ADDED
|
models/tenpenny/cover.png
ADDED
|
models/tommy/cover.png
ADDED
|
models/wuzimu/cover.png
ADDED
|