File size: 602 Bytes
00f35fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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) # ['开灯', '今天天气怎么样', '把窗帘拉开', '放首英文歌']