音频操作

Take a listen to a number of demo songs presenting RealGuitar in various music styles.

初始化对象

1
2
3
4
5
6
7
8
let audio = new Audio()
audio.src = ''
audio.autoplay = false
audio.loop = false
this.audio.crossOrigin = 'anonymous'
if(audio.readyState ===0){
console.log('music is stating')
}

获取进度

1
currentStatus = (audio.currentTime / audio.duration).toFixed(2)