We are trying to upgrade to the latest version of Tone JS, which appears to be 14.8.32, according to cdnjs. We are currently using 14.8.6. All versions above 14.8.6 fail on the following lines of code:
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
var request = new XMLHttpRequest();
request.open('GET', 'https://mdn.github.io/webaudio-examples/decode-audio-data/viper.mp3', true);
request.responseType = 'arraybuffer';
request.onload = function() {
let audioData = request.response;
audioContext.decodeAudioData(audioData, (buffer) => {
var toneAudioBuffer = new Tone.ToneAudioBuffer(buffer);
console.log(toneAudioBuffer.length, toneAudioBuffer.duration);
})
};
request.send();
The line that yields different results is:
new Tone.ToneAudioBuffer(buffer)
In this line the ToneAudioBuffer returns a valid buffer with duration and length in 14.8.6, but all versions above that return 0 for the duration and length. We have tested this on Chrome and Safari, both of which yield the same results.
Hi There
We are trying to upgrade to the latest version of Tone JS, which appears to be 14.8.32, according to cdnjs. We are currently using 14.8.6. All versions above 14.8.6 fail on the following lines of code:
The line that yields different results is:
new Tone.ToneAudioBuffer(buffer)
In this line the ToneAudioBuffer returns a valid buffer with duration and length in 14.8.6, but all versions above that return 0 for the duration and length. We have tested this on Chrome and Safari, both of which yield the same results.
Thank you for your help. Abs www.dappledark.com