HoneyTian commited on
Commit
b06194e
·
1 Parent(s): e3dd4fb
Files changed (2) hide show
  1. main.py +1 -1
  2. silero/main.go +2 -2
main.py CHANGED
@@ -71,7 +71,7 @@ def run_silero_vad(filename: str, silence_time: float = 0.3, longest_activate: f
71
  )
72
  raw_vad_result = Command.popen(cmd)
73
 
74
- pattern = ".*?speech starts at (.+?)s[\r\n].*?speech ends at (.+?)s"
75
 
76
  vad_timestamps = re.findall(pattern, raw_vad_result, flags=re.DOTALL)
77
  vad_timestamps = [(float(start), float(end)) for start, end in vad_timestamps]
 
71
  )
72
  raw_vad_result = Command.popen(cmd)
73
 
74
+ pattern = "speech starts at (.+?)s[\r\n].*?speech ends at (.+?)s"
75
 
76
  vad_timestamps = re.findall(pattern, raw_vad_result, flags=re.DOTALL)
77
  vad_timestamps = [(float(start), float(end)) for start, end in vad_timestamps]
silero/main.go CHANGED
@@ -49,10 +49,10 @@ func main() {
49
  }
50
 
51
  for _, s := range segments {
52
- fmt.Printf("speech starts at %0.2fs", s.SpeechStartAt)
53
 
54
  if s.SpeechEndAt > 0 {
55
- fmt.Printf("speech ends at %0.2fs", s.SpeechEndAt)
56
  }
57
  }
58
 
 
49
  }
50
 
51
  for _, s := range segments {
52
+ fmt.Printf("speech starts at %0.2fs\n", s.SpeechStartAt)
53
 
54
  if s.SpeechEndAt > 0 {
55
+ fmt.Printf("speech ends at %0.2fs\n", s.SpeechEndAt)
56
  }
57
  }
58