onclick="location.href=`#{id}`"
var audio = document.querySelector('.track_audio');
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
var getTrackDuration = function () {
let xhr = new XMLHttpRequest();
xhr.open('GET', `${audio.src}`);
xhr.responseType = 'arraybuffer';
xhr.onload = function () {
audioContext.decodeAudioData(xhr.response, function(buffer) {
var duration = buffer.duration;
document.querySelector('.duration_track').innerHTML = `${duration}`
});
}
xhr.send();
}
getTrackDuration();