传入字符串类型歌词,按照正则表达式解析,解析的数据结构为:
{
txt:歌词,
time:ms
}
npm install xieyezi-lyric
import xieyeziLyric form 'xieyezi-lyric';
var Lyric = new Lyric(lyric,handle);
console.log(Lyric);
//支持传入一个处理函数“handle”
//js里面的handle函数
_callHandler(i) {
if (i < 0) {
return;
}
this.handler({
txt: this.lines[i].txt,
lineNum: i
})
}