|
|
|
@ -15,7 +15,7 @@ import argparse
|
|
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
import time
|
|
|
|
|
from io import BytesIO
|
|
|
|
|
import io
|
|
|
|
|
from collections import OrderedDict
|
|
|
|
|
from typing import List
|
|
|
|
|
from typing import Optional
|
|
|
|
@ -230,7 +230,7 @@ class ASRExecutor(BaseExecutor):
|
|
|
|
|
audio_file = input
|
|
|
|
|
if isinstance(audio_file, (str, os.PathLike)):
|
|
|
|
|
logger.debug("Preprocess audio_file:" + audio_file)
|
|
|
|
|
elif isinstance(audio_file, BytesIO):
|
|
|
|
|
elif isinstance(audio_file, io.BytesIO):
|
|
|
|
|
audio_file.seek(0)
|
|
|
|
|
|
|
|
|
|
# Get the object for feature extraction
|
|
|
|
@ -355,7 +355,7 @@ class ASRExecutor(BaseExecutor):
|
|
|
|
|
if not os.path.isfile(audio_file):
|
|
|
|
|
logger.error("Please input the right audio file path")
|
|
|
|
|
return False
|
|
|
|
|
elif isinstance(audio_file, BytesIO):
|
|
|
|
|
elif isinstance(audio_file, io.BytesIO):
|
|
|
|
|
audio_file.seek(0)
|
|
|
|
|
|
|
|
|
|
logger.debug("checking the audio file format......")
|
|
|
|
|