ibombonato commited on
Commit
8e7360f
·
1 Parent(s): 84943ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -27,10 +27,13 @@ def get_chunk_times(in_filename, silence_threshold, silence_duration=1):
27
  logging.info(f"Absolue path: {fpath}")
28
 
29
  command = f"ffmpeg -i {in_filename} -af silencedetect=n=-{silence_threshold}dB:d={silence_duration} -f null - "
30
- out = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
31
-
32
- stdout, stderr = out.communicate()
33
 
 
 
 
 
 
34
  lines = stdout.splitlines()
35
 
36
  ts = 0
 
27
  logging.info(f"Absolue path: {fpath}")
28
 
29
  command = f"ffmpeg -i {in_filename} -af silencedetect=n=-{silence_threshold}dB:d={silence_duration} -f null - "
30
+ #out = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 
 
31
 
32
+ #stdout, stderr = out.communicate()
33
+
34
+ out = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
35
+ stdout = out.stdout
36
+
37
  lines = stdout.splitlines()
38
 
39
  ts = 0