Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files164 unmodified lines16516616716816917017127 unmodified lines19920020120220320482 unmodified lines28728828929029129229337 unmodified lines331332333334335336337338339164 unmodified linesprint("audio splitting performed")vocal_path = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/vocals.wav"inst = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)output_path1= combine_vocal_and_inst(output_path,inst,unique_id)27 unmodified linesdef convert_voice(spk_id, input_audio_path, voice_transform,unique_id):get_vc(spk_id,0.5)output_audio_path = vc_single(sid=0,input_audio_path=input_audio_path,82 unmodified linesunique_id): # spk_item, input_audio0, vc_transform0,f0_file,f0method0global tgt_sr, net_g, vc, hubert_model, version, cpttry:logs = []print(f"Converting...")37 unmodified linesprint("writing to FS")#output_file_path = os.path.join("output", f"converted_audio_{sid}.wav") # Adjust path as needed# Assuming 'unique_id' is passed to convert_voice function along with 'sid'output_file_path = os.path.join("output", f"converted_audio_{sid}_{unique_id}.wav") # Adjust path as neededos.makedirs(os.path.dirname(output_file_path), exist_ok=True) # Create the output directory if it doesn't existprint("create dir")# Save the audio file using the target sampling rate164 unmodified lines16516616716816917017127 unmodified lines19920020120220320420520620782 unmodified lines29029129229329429529629737 unmodified lines335336337338339340341342343344164 unmodified linesprint("audio splitting performed")vocal_path = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/vocals.wav"inst = f"output/{spk_id}_{unique_id}/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"print("*****before making call to convert ", unique_id)output_path = convert_voice(spk_id, vocal_path, voice_transform,unique_id)output_path1= combine_vocal_and_inst(output_path,inst,unique_id)27 unmodified linesdef convert_voice(spk_id, input_audio_path, voice_transform,unique_id):get_vc(spk_id,0.5)print("*****before makinf call to vc ", unique_id)output_audio_path = vc_single(sid=0,input_audio_path=input_audio_path,82 unmodified linesunique_id): # spk_item, input_audio0, vc_transform0,f0_file,f0method0global tgt_sr, net_g, vc, hubert_model, version, cptprint("***** in vc ", unique_id)try:logs = []print(f"Converting...")37 unmodified linesprint("writing to FS")#output_file_path = os.path.join("output", f"converted_audio_{sid}.wav") # Adjust path as needed# Assuming 'unique_id' is passed to convert_voice function along with 'sid'print("***** before writing to file outout ", unique_id)output_file_path = os.path.join("output", f"converted_audio_{sid}_{unique_id}.wav") # Adjust path as neededprint("******* output file path ",output_file_path)os.makedirs(os.path.dirname(output_file_path), exist_ok=True) # Create the output directory if it doesn't existprint("create dir")# Save the audio file using the target sampling rate
myinfer_latest.py+8-3