Update rvcfunc.py
Browse files- rvcfunc.py +0 -20
rvcfunc.py
CHANGED
@@ -158,26 +158,6 @@ def stereo_process(audio1,audio2,choice):
|
|
158 |
else:
|
159 |
return audio
|
160 |
|
161 |
-
def sr_process(audio1, audio2, choice):
|
162 |
-
torch.cuda.empty_cache()
|
163 |
-
gc.collect()
|
164 |
-
if "tts_pipe" in locals(): del tts_pipe
|
165 |
-
audio = audio1 if choice == "Input" else audio2
|
166 |
-
sample_rate, audio_array = audio
|
167 |
-
audio_segment = AudioSegment(
|
168 |
-
audio_array.tobytes(),
|
169 |
-
frame_rate=sample_rate,
|
170 |
-
sample_width=audio_array.dtype.itemsize,
|
171 |
-
channels=1 if len(audio_array.shape) == 1 else 2
|
172 |
-
)
|
173 |
-
temp_file = os.path.join('TEMP', f'{choice}_{datetime.now().strftime("%Y%m%d_%H%M%S")}.wav')
|
174 |
-
audio_segment.export(temp_file, format="wav")
|
175 |
-
output_folder = "SR"
|
176 |
-
model_name = "speech"
|
177 |
-
suffix = "_ldm"
|
178 |
-
guidance_scale = 2.7
|
179 |
-
ddim_steps = 50
|
180 |
-
venv_dir = "audiosr"
|
181 |
|
182 |
def split_audio(input_file, output_folder, chunk_duration=5.12):
|
183 |
os.makedirs(output_folder, exist_ok=True)
|
|
|
158 |
else:
|
159 |
return audio
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
def split_audio(input_file, output_folder, chunk_duration=5.12):
|
163 |
os.makedirs(output_folder, exist_ok=True)
|