提交 8b4602f7 编写于 作者: W WilliamZhang06

added isinstance code, test=doc

上级 147018a8
......@@ -412,6 +412,11 @@ class ASRExecutor(BaseExecutor):
logger.error("invalid sample rate, please input --sr 8000 or --sr 16000")
return False
if isinstance(audio_file, (str, os.PathLike)):
if not os.path.isfile(audio_file):
logger.error("Please input the right audio file path")
return False
logger.info("checking the audio file format......")
try:
audio, audio_sample_rate = soundfile.read(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册