mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
Update vad.py
This commit is contained in:
parent
d7c45cf83b
commit
0489003dd4
1 changed files with 2 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import opuslib
|
||||||
import time
|
import time
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
|
from core.utils.performance_monitor import track_performance
|
||||||
|
|
||||||
TAG = __name__
|
TAG = __name__
|
||||||
logger = setup_logging()
|
logger = setup_logging()
|
||||||
|
|
@ -28,6 +29,7 @@ class SileroVAD(VAD):
|
||||||
self.vad_threshold = config.get("threshold")
|
self.vad_threshold = config.get("threshold")
|
||||||
self.silence_threshold_ms = config.get("min_silence_duration_ms")
|
self.silence_threshold_ms = config.get("min_silence_duration_ms")
|
||||||
|
|
||||||
|
@track_performance("VAD")
|
||||||
def is_vad(self, conn, opus_packet):
|
def is_vad(self, conn, opus_packet):
|
||||||
try:
|
try:
|
||||||
pcm_frame = self.decoder.decode(opus_packet, 960)
|
pcm_frame = self.decoder.decode(opus_packet, 960)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue