Spaces:
Sleeping
Sleeping
update
Browse files- README.md +2 -2
- silero_vad/main.go +19 -3
README.md
CHANGED
@@ -13,12 +13,12 @@ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-
|
|
13 |
### Vad GO
|
14 |
|
15 |
```text
|
16 |
-
docker build -t vad_go:
|
17 |
|
18 |
docker run -itd \
|
19 |
--name vad_go \
|
20 |
--network host \
|
21 |
-
vad_go:
|
22 |
|
23 |
http://10.75.27.247:7860
|
24 |
```
|
|
|
13 |
### Vad GO
|
14 |
|
15 |
```text
|
16 |
+
docker build -t vad_go:v20241211_1518 .
|
17 |
|
18 |
docker run -itd \
|
19 |
--name vad_go \
|
20 |
--network host \
|
21 |
+
vad_go:v20241211_1518
|
22 |
|
23 |
http://10.75.27.247:7860
|
24 |
```
|
silero_vad/main.go
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
package main
|
2 |
|
3 |
import (
|
|
|
4 |
"fmt"
|
5 |
"log"
|
6 |
"os"
|
@@ -9,12 +10,27 @@ import (
|
|
9 |
)
|
10 |
|
11 |
func main() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
sd, err := speech.NewDetector(speech.DetectorConfig{
|
13 |
-
ModelPath:
|
14 |
SampleRate: 8000,
|
15 |
Threshold: 0.5,
|
16 |
-
MinSilenceDurationMs:
|
17 |
-
SpeechPadMs:
|
18 |
})
|
19 |
if err != nil {
|
20 |
log.Fatalf("failed to create speech detector: %s", err)
|
|
|
1 |
package main
|
2 |
|
3 |
import (
|
4 |
+
"flag"
|
5 |
"fmt"
|
6 |
"log"
|
7 |
"os"
|
|
|
10 |
)
|
11 |
|
12 |
func main() {
|
13 |
+
modelPathPtr := flag.String("model_path", "./pretrained_models/silero_vad/silero_vad.onnx", "silero vad onnx model")
|
14 |
+
filenamePtr := flag.String("filename", "", "input wav audio file")
|
15 |
+
silenceTimePtr := flag.Float64("silence_time", 0.1, "in the end of each speech chunk wait for min_silence_duration_ms before separating it")
|
16 |
+
speechPadTimePtr := flag.Float64("speech_pad_time", 0.03, "final speech chunks are padded by speech_pad_ms each side")
|
17 |
+
flag.Parse()
|
18 |
+
|
19 |
+
var modelPath string = *modelPathPtr
|
20 |
+
var filename string = *filenamePtr
|
21 |
+
var silenceTime float32 = float32(*silenceTimePtr)
|
22 |
+
var speechPadTime float32 = float32(*speechPadTimePtr)
|
23 |
+
fmt.Println(filename)
|
24 |
+
|
25 |
+
var silenceTimeMs uint32 = uint32(silenceTime * 1e3)
|
26 |
+
var speechPadTimeMs uint32 = uint32(speechPadTime * 1e3)
|
27 |
+
|
28 |
sd, err := speech.NewDetector(speech.DetectorConfig{
|
29 |
+
ModelPath: modelPath,
|
30 |
SampleRate: 8000,
|
31 |
Threshold: 0.5,
|
32 |
+
MinSilenceDurationMs: silenceTimeMs,
|
33 |
+
SpeechPadMs: speechPadTimeMs,
|
34 |
})
|
35 |
if err != nil {
|
36 |
log.Fatalf("failed to create speech detector: %s", err)
|