HoneyTian commited on
Commit
5b04086
·
1 Parent(s): 850c5ff
Files changed (1) hide show
  1. main.py +14 -1
main.py CHANGED
@@ -41,7 +41,7 @@ def process_uploaded_file(vad_engine: str, filename: str, silence_time: float =
41
  def run_nx_vad(filename: str, silence_time: float = 0.3, longest_activate: float = 3.0) -> str:
42
  filename = Path(filename).as_posix()
43
 
44
- main_logger.info("do vad: {}".format(filename))
45
 
46
  cmd = "vad_bins/nx_vad --filename {} --silence_time {} --longest_activate {}".format(
47
  filename, silence_time, longest_activate
@@ -57,6 +57,19 @@ def run_nx_vad(filename: str, silence_time: float = 0.3, longest_activate: float
57
  return vad_timestamps
58
 
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  def shell(cmd: str):
61
  return Command.popen(cmd)
62
 
 
41
  def run_nx_vad(filename: str, silence_time: float = 0.3, longest_activate: float = 3.0) -> str:
42
  filename = Path(filename).as_posix()
43
 
44
+ main_logger.info("do nx vad: {}".format(filename))
45
 
46
  cmd = "vad_bins/nx_vad --filename {} --silence_time {} --longest_activate {}".format(
47
  filename, silence_time, longest_activate
 
57
  return vad_timestamps
58
 
59
 
60
+ def run_silero_vad(filename: str, silence_time: float = 0.3, longest_activate: float = 3.0) -> str:
61
+ filename = Path(filename).as_posix()
62
+
63
+ main_logger.info("do silero vad: {}".format(filename))
64
+
65
+ cmd = "vad_bins/silero {}".format(
66
+ filename
67
+ )
68
+ vad_result = Command.popen(cmd)
69
+
70
+ return vad_result
71
+
72
+
73
  def shell(cmd: str):
74
  return Command.popen(cmd)
75