From 9f4bb0a0ee2e0c4e48fa06156ece67603b3098d7 Mon Sep 17 00:00:00 2001
From: R1ckShi <2698127294@qq.com>
Date: 星期二, 31 一月 2023 15:32:15 +0800
Subject: [PATCH] egs for paraformer-tiny
---
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