smjain commited on
Commit
1ff6c08
1 Parent(s): 44f5921

Upload myinfer_latest.py

Browse files
Files changed (1) hide show
  1. myinfer_latest.py +3 -3
myinfer_latest.py CHANGED
@@ -145,7 +145,7 @@ def api_convert_voice():
145
  inst = f"output/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"
146
 
147
  output_path = convert_voice(spk_id, vocal_path, voice_transform)
148
- output_path1= combine_vocal_and_inst(output_path,inst)
149
 
150
  processed_audio_storage[unique_id] = output_path1
151
  session['processed_audio_id'] = unique_id
@@ -218,13 +218,13 @@ def cut_vocal_and_inst(audio_path,spk_id):
218
  #logs.append("Audio splitting complete.")
219
 
220
 
221
- def combine_vocal_and_inst(vocal_path, inst_path):
222
 
223
  vocal_volume=1
224
  inst_volume=1
225
  os.makedirs("output/result", exist_ok=True)
226
  # Assuming vocal_path and inst_path are now directly passed as arguments
227
- output_path = "output/result/combine.mp3"
228
  #command = f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex [0:a]volume={inst_volume}[i];[1:a]volume={vocal_volume}[v];[i][v]amix=inputs=2:duration=longest[a] -map [a] -b:a 320k -c:a libmp3lame "{output_path}"'
229
  #command=f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex "amix=inputs=2:duration=longest" -b:a 320k -c:a libmp3lame "{output_path}"'
230
  # Load the audio files
 
145
  inst = f"output/{split_model}/{spk_id}_input_audio_{unique_id}/no_vocals.wav"
146
 
147
  output_path = convert_voice(spk_id, vocal_path, voice_transform)
148
+ output_path1= combine_vocal_and_inst(output_path,inst,unique_id)
149
 
150
  processed_audio_storage[unique_id] = output_path1
151
  session['processed_audio_id'] = unique_id
 
218
  #logs.append("Audio splitting complete.")
219
 
220
 
221
+ def combine_vocal_and_inst(vocal_path, inst_path, output_path):
222
 
223
  vocal_volume=1
224
  inst_volume=1
225
  os.makedirs("output/result", exist_ok=True)
226
  # Assuming vocal_path and inst_path are now directly passed as arguments
227
+ output_path = f"output/result/{output_path}.mp3"
228
  #command = f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex [0:a]volume={inst_volume}[i];[1:a]volume={vocal_volume}[v];[i][v]amix=inputs=2:duration=longest[a] -map [a] -b:a 320k -c:a libmp3lame "{output_path}"'
229
  #command=f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex "amix=inputs=2:duration=longest" -b:a 320k -c:a libmp3lame "{output_path}"'
230
  # Load the audio files