Tone.js icon indicating copy to clipboard operation
Tone.js copied to clipboard

Strange Tone.Bitcrush error on Firefox

Open thely opened this issue 3 years ago • 3 comments

Describe the bug

I'm getting an error that has plagued me for awhile by being completely inexplicable. I haven't known what's been causing it, because it doesn't provide a lot of information about itself. It looks like this:

TypeError: i[0][0] is undefined
    process blob:http://localhost:7000/922feb6f-f60e-eb47-bad9-693dcd74cbe4:1

Of the two blobs I see in the debugger (both of which I think are related to Tone), neither of them has this hash string. As far as I can tell, the blob it's expecting doesn't exist. But after doing some breakpoint sleuthing, it's happening when I make a new bitcrusher. It doesn't seem like it's hurting anything, but I also have no idea why it's happening.

I've tried this in Chrome and Firefox, and it's only happening in Firefox.

To Reproduce

Make a new Bitcrusher in Firefox. Open this CodePen, look at the console, see the error.

Expected behavior Not to see this error? I haven't tested to see if it's preventing the bitcrusher from working, but the rest of the audio in my project is working fine, so I haven't tried to find the source of the issues until today.

What I've tried I haven't dug much into the Tone source code, so I don't know where this is from. Discovering the actual source of the error was enough on its own!

Other details

I'm on Firefox 89.0.2 (64-bit), on Mac OS 10.14.6.

thely avatar Jun 27 '21 20:06 thely

thanks @thely, very strange error. My guess is that it comes from the BitCrusher's AudioWorklet script which is loaded using a Blob Url. I'm not sure why it's appearing in this case though, i will try and investigate further.

tambien avatar Jul 01 '21 19:07 tambien

Hi @tambien, maybe this helps investigating this further. I noticed that in Firefox sometimes the input data isn't present for the first one or two invocations of the process() function.

chrisguttandin avatar Jul 01 '21 19:07 chrisguttandin

@chrisguttandin interesting, thanks for the tip

tambien avatar Jul 01 '21 20:07 tambien