From 4e95ad3c4985dce64009ceeee70e30f9742418cd Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期四, 15 六月 2023 16:41:36 +0800
Subject: [PATCH] For python ws client long wav not recv asr result bug (#633)

---
 funasr/bin/vad_infer.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/funasr/bin/vad_infer.py b/funasr/bin/vad_infer.py
index 5835e77..e1698d0 100644
--- a/funasr/bin/vad_infer.py
+++ b/funasr/bin/vad_infer.py
@@ -1,3 +1,8 @@
+# -*- encoding: utf-8 -*-
+#!/usr/bin/env python3
+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
+#  MIT License  (https://opensource.org/licenses/MIT)
+
 import argparse
 import logging
 import os
@@ -170,7 +175,8 @@
         batch_size = speech.shape[0]
         segments = [[]] * batch_size
         if self.frontend is not None:
-            feats, feats_len = self.frontend.forward(speech, speech_lengths, is_final)
+            reset = in_cache == dict()
+            feats, feats_len = self.frontend.forward(speech, speech_lengths, is_final, reset)
             fbanks, _ = self.frontend.get_fbank()
         else:
             raise Exception("Need to extract feats first, please configure frontend configuration")

--
Gitblit v1.9.1