From adcee8828ef5d78b575043954deb662a35e318f7 Mon Sep 17 00:00:00 2001
From: huangmingming <huangmingming@deepscience.cn>
Date: 星期一, 30 一月 2023 16:02:54 +0800
Subject: [PATCH] update the minimum size of audio

---
 funasr/utils/asr_utils.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/funasr/utils/asr_utils.py b/funasr/utils/asr_utils.py
index 4258f05..0bf903c 100644
--- a/funasr/utils/asr_utils.py
+++ b/funasr/utils/asr_utils.py
@@ -49,12 +49,20 @@
         r_audio_format = 'pcm'
         r_recog_type = 'wav'
 
-    if r_recog_type is None:
+    if audio_in is None:
+        # for raw_inputs
+        r_recog_type = 'wav'
+        r_audio_format = 'pcm'
+
+    if r_recog_type is None and audio_in is not None:
         # audio_in is wav, recog_type is wav_file
         if os.path.isfile(audio_in):
             if audio_in.endswith('.wav') or audio_in.endswith('.WAV'):
                 r_recog_type = 'wav'
                 r_audio_format = 'wav'
+            elif audio_in.endswith('.scp') or audio_in.endswith('.SCP'):
+                r_recog_type = 'wav'
+                r_audio_format = 'scp'
 
         # recog_type is datasets_file
         elif os.path.isdir(audio_in):

--
Gitblit v1.9.1