mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-08 07:49:59 +08:00
fix: 移除多余 my_utils.py (#1189)
This commit is contained in:
parent
d1d43661a9
commit
06429f78cd
@ -65,7 +65,7 @@ from text import cleaned_text_to_sequence
|
|||||||
from text.cleaner import clean_text
|
from text.cleaner import clean_text
|
||||||
from time import time as ttime
|
from time import time as ttime
|
||||||
from module.mel_processing import spectrogram_torch
|
from module.mel_processing import spectrogram_torch
|
||||||
from my_utils import load_audio
|
from tools.my_utils import load_audio
|
||||||
from tools.i18n.i18n import I18nAuto
|
from tools.i18n.i18n import I18nAuto
|
||||||
|
|
||||||
i18n = I18nAuto()
|
i18n = I18nAuto()
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
import ffmpeg
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
|
|
||||||
def load_audio(file, sr):
|
|
||||||
try:
|
|
||||||
# https://github.com/openai/whisper/blob/main/whisper/audio.py#L26
|
|
||||||
# This launches a subprocess to decode audio while down-mixing and resampling as necessary.
|
|
||||||
# Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
|
|
||||||
file = (
|
|
||||||
file.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
|
|
||||||
) # 防止小白拷路径头尾带了空格和"和回车
|
|
||||||
out, _ = (
|
|
||||||
ffmpeg.input(file, threads=0)
|
|
||||||
.output("-", format="f32le", acodec="pcm_f32le", ac=1, ar=sr)
|
|
||||||
.run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
|
|
||||||
)
|
|
||||||
except Exception as e:
|
|
||||||
raise RuntimeError(f"Failed to load audio: {e}")
|
|
||||||
|
|
||||||
return np.frombuffer(out, np.float32).flatten()
|
|
@ -9,7 +9,7 @@ cnhubert.cnhubert_base_path=cnhubert_base_path
|
|||||||
ssl_model = cnhubert.get_model()
|
ssl_model = cnhubert.get_model()
|
||||||
from text import cleaned_text_to_sequence
|
from text import cleaned_text_to_sequence
|
||||||
import soundfile
|
import soundfile
|
||||||
from my_utils import load_audio
|
from tools.my_utils import load_audio
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user