| | |
| | | from funasr import AutoModel |
| | | wav_file = "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/vad_example.wav" |
| | | |
| | | model = AutoModel(model="damo/speech_fsmn_vad_zh-cn-16k-common-pytorch", model_revision="v2.0.4") |
| | | model = AutoModel(model="iic/speech_fsmn_vad_zh-cn-16k-common-pytorch") |
| | | |
| | | res = model.generate(input=wav_file) |
| | | print(res) |
| | | # [[beg1, end1], [beg2, end2], .., [begN, endN]] |
| | | # beg/end: ms |
| | | |
| | | |
| | | |
| | |
| | | # print(res) |
| | | if len(res[0]["value"]): |
| | | print(res) |
| | | |
| | | |
| | | # 1. [[beg1, end1], [beg2, end2], .., [begN, endN]]; [[beg, end]]; [[beg1, end1], [beg2, end2]] |
| | | # 2. [[beg, -1]] |
| | | # 3. [[-1, end]] |
| | | # beg/end: ms |