debug icon indicating copy to clipboard operation
debug copied to clipboard

colors not detected in AudioWorkletProcessor

Open ibc opened this issue 5 years ago • 0 comments

https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor

The AudioWorkletProcessor interface of the Web Audio API represents an audio processing code behind a custom AudioWorkletNode. It lives in the AudioWorkletGlobalScope and runs on the Web Audio rendering thread. In turn, an AudioWorkletNode based on it runs on the main thread.

The application creates a file containing the definition of a class inheriting from AudioWorkletProcessor and writes JS on it. It can use debug module or console directly and, auto-magically, Chrome redirects its output to DevTools console.

However there are no colors because this useColors() function returns false. Setting debugInstance.useColors = true manually (which is ugly and non public API) does work.

In Node there is a DEBUG_COLORS env to force colors. In browser there is no way to manually force colors in corner (but IMHO legit) cases like the above one. May I suggest a debugInstance.forceColors() method or something like that?

ibc avatar Jan 22 '20 17:01 ibc