r3gm commited on
Commit
c6cfd5d
1 Parent(s): 27ad614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -242,7 +242,7 @@ def translate_from_video(video, WHISPER_MODEL_SIZE, batch_size, compute_type,
242
  os.system(f"rm {mix_audio}")
243
  #os.system(f'''ffmpeg -i {audio_wav} -i audio_dub_stereo.wav -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress=threshold=0.003:ratio=20[bg]; [bg][mix]amerge[final]" -map [final] {mix_audio}''')
244
  #os.system(f'ffmpeg -y -i {audio_wav} -i audio_dub_stereo.wav -filter_complex "[0:0][1:0] amix=inputs=2:duration=longest" -c:a libmp3lame {mix_audio}')
245
- os.system(f'ffmpeg -y -i audio.wav -i audio_dub_stereo.wav -filter_complex "[0:0]volume=0.20[a];[1:0]volume=1.85[b];[a][b]amix=inputs=2:duration=longest" -c:a libmp3lame {mix_audio}')
246
 
247
  os.system(f"rm {video_output}")
248
  os.system(f"ffmpeg -i {OutputFile} -i {mix_audio} -c:v copy -c:a copy -map 0:v -map 1:a -shortest {video_output}")
@@ -274,7 +274,10 @@ sys.stdout = Logger("output.log")
274
  def read_logs():
275
  sys.stdout.flush()
276
  with open("output.log", "r") as f:
277
- return f.read()
 
 
 
278
 
279
 
280
  with gr.Blocks() as demo:
 
242
  os.system(f"rm {mix_audio}")
243
  #os.system(f'''ffmpeg -i {audio_wav} -i audio_dub_stereo.wav -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress=threshold=0.003:ratio=20[bg]; [bg][mix]amerge[final]" -map [final] {mix_audio}''')
244
  #os.system(f'ffmpeg -y -i {audio_wav} -i audio_dub_stereo.wav -filter_complex "[0:0][1:0] amix=inputs=2:duration=longest" -c:a libmp3lame {mix_audio}')
245
+ os.system(f'ffmpeg -y -i audio.wav -i audio_dub_stereo.wav -filter_complex "[0:0]volume=0.15[a];[1:0]volume=1.90[b];[a][b]amix=inputs=2:duration=longest" -c:a libmp3lame {mix_audio}')
246
 
247
  os.system(f"rm {video_output}")
248
  os.system(f"ffmpeg -i {OutputFile} -i {mix_audio} -c:v copy -c:a copy -map 0:v -map 1:a -shortest {video_output}")
 
274
  def read_logs():
275
  sys.stdout.flush()
276
  with open("output.log", "r") as f:
277
+ if f.read()[:17] == "Model was trained"
278
+ return f.read()
279
+ else:
280
+ return "."
281
 
282
 
283
  with gr.Blocks() as demo: