abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Error in playback using Chrome Version 96.0.4664.27 (Official Build) beta (64-bit) on Ubuntu 20.04

Open asjl opened this issue 3 years ago • 2 comments

I'm seeing an issue with playing music back using the Editor code. I tried to play back the ABC music on this page:

https://wellington.session.nz/tunes/air-tune-the.html

I've tried with other tunes on the page https://wellington.session.nz/tunes_archive/ - similar problems

When I hit the playback arrow below the music I get a spinning arrow and error messages that look like these (tens of messages in the tunes I tried)

VM6:731 Uncaught TypeError: Cannot read properties of undefined (reading 'length') at shouldExemptMethod (:731:31) at Object.outputHandler [as apply] (:828:31) at copyToChannel (abcjs-basic.js:15796) at OfflineAudioContext.offlineCtx.oncomplete (abcjs-basic.js:15781) shouldExemptMethod @ VM6:731 outputHandler @ VM6:828 copyToChannel @ abcjs-basic.js:15796 offlineCtx.oncomplete @ abcjs-basic.js:15781

That site uses abcjs beta 33. I've also tried against my development site at dev.session.nz running beta 35 - same problem.

I don't see an issue with Firefox or with Chrome Version 92

I added some debugging code on an internal server:

var copyToChannel = function copyToChannel(toBuffer, fromBuffer, start) { console.log(toBuffer, fromBuffer, start); for (var ch = 0; ch < 2; ch++) { console.log("getting fromData: channel ", ch); var fromData = fromBuffer.getChannelData(ch); console.log("getting toData: channel ", ch); var toData = toBuffer.getChannelData(ch); // Mix the current note into the existing track

for (var n = 0; n < fromData.length; n++) {
  toData[n + start] += fromData[n];
}

} };

and I get messages like:

AudioBuffer {length: 1890420, duration: 42.86666666666667, sampleRate: 44100, numberOfChannels: 2} AudioBuffer {length: 16170, duration: 0.36666666666666664, sampleRate: 44100, numberOfChannels: 2} 455700 getting fromData: channel 0

VM6:731 Uncaught TypeError: Cannot read properties of undefined (reading 'length') at shouldExemptMethod (:731:31) at Object.outputHandler [as apply] (:828:31) at copyToChannel (abcjs-basic.js:15901) at OfflineAudioContext.offlineCtx.oncomplete (abcjs-basic.js:15884) shouldExemptMethod @ VM6:731 outputHandler @ VM6:828 copyToChannel @ abcjs-basic.js:15901 offlineCtx.oncomplete @ abcjs-basic.js:15884

I'm reading this as the problem lies when the line:

var fromData = fromBuffer.getChannelData(ch);

is executed.

Any hints?

asjl avatar Nov 08 '21 21:11 asjl

I've done some more on this. It's an issue with the DuckDuckGo security extension for both Chrome and Firefox.

https://chrome.google.com/webstore/detail/duckduckgo-privacy-essent/bkdgflcldnnnapblkhphbgpggdiikppg https://addons.mozilla.org/en-US/firefox/addon/duckduckgo-for-firefox/

This has been recently updated so I suspect that's why it's appeared suddenly - I will attempt to lodge a bug with them.

Andy

asjl avatar Nov 08 '21 23:11 asjl

I guess all I can do is give a clearer error message in this case. I guess the immediate problem is the return value from the processing in the variable renderedBuffer is not delivered. I suspect that the mp3 was blocked from loading, perhaps? Is there anything funny in the browser's network tab?

When I get a moment I'll install that plugin and see if I can reproduce. It won't be right away, though.

I can't imagine that plugin interfering with the audio processing itself. That's why I would look at blocking the file load first.

paulrosen avatar Nov 13 '21 21:11 paulrosen