import time from lasr.process.asrprocess import ASRProcess train_config="./hparams.yaml" decode_config="./decode.yaml" model_path="./model.ckpt" asrpipeline = ASRProcess( train_config=train_config, decode_config=decode_config, model_path=model_path ) list = [] pathList = ['开灯.wav', '今天天气怎么样.wav', '把窗帘拉开.wav', '放首英文歌.wav'] for item in pathList: pathname = './datasets/'+item token, text = asrpipeline(pathname) time.sleep(3) list.append(text) print(list) # ['开灯', '今天天气怎么样', '把窗帘拉开', '放首英文歌']