Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files- myinfer_latest.py +7 -2
myinfer_latest.py
CHANGED
|
@@ -169,7 +169,7 @@ def api_convert_voice():
|
|
| 169 |
vocal_path = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/vocals.wav"
|
| 170 |
inst = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"
|
| 171 |
print("*****before making call to convert ", unique_id)
|
| 172 |
-
output_path =
|
| 173 |
output_path1= combine_vocal_and_inst(output_path,inst,unique_id)
|
| 174 |
|
| 175 |
processed_audio_storage[unique_id] = output_path1
|
|
@@ -192,6 +192,11 @@ def convert_voice_thread_safe(spk_id, vocal_path, voice_transform, unique_id):
|
|
| 192 |
return convert_voice(spk_id, vocal_path, voice_transform, unique_id)
|
| 193 |
|
| 194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
@app.route('/')
|
| 196 |
def upload_form():
|
| 197 |
return render_template('ui.html')
|
|
@@ -206,7 +211,7 @@ def get_processed_audio(audio_id):
|
|
| 206 |
|
| 207 |
|
| 208 |
def convert_voice(spk_id, input_audio_path, voice_transform,unique_id):
|
| 209 |
-
|
| 210 |
print("*****before makinf call to vc ", unique_id)
|
| 211 |
|
| 212 |
|
|
|
|
| 169 |
vocal_path = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/vocals.wav"
|
| 170 |
inst = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"
|
| 171 |
print("*****before making call to convert ", unique_id)
|
| 172 |
+
output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)
|
| 173 |
output_path1= combine_vocal_and_inst(output_path,inst,unique_id)
|
| 174 |
|
| 175 |
processed_audio_storage[unique_id] = output_path1
|
|
|
|
| 192 |
return convert_voice(spk_id, vocal_path, voice_transform, unique_id)
|
| 193 |
|
| 194 |
|
| 195 |
+
|
| 196 |
+
def get_vc_safe(sid, to_return_protect0):
|
| 197 |
+
with convert_voice_lock:
|
| 198 |
+
return get_vc(sid, to_return_protect0)
|
| 199 |
+
|
| 200 |
@app.route('/')
|
| 201 |
def upload_form():
|
| 202 |
return render_template('ui.html')
|
|
|
|
| 211 |
|
| 212 |
|
| 213 |
def convert_voice(spk_id, input_audio_path, voice_transform,unique_id):
|
| 214 |
+
get_vc_safe(spk_id,0.5)
|
| 215 |
print("*****before makinf call to vc ", unique_id)
|
| 216 |
|
| 217 |
|