I've encountered a problem with the Tone.Analyzer
in Safari 10.1.
When setting the Tone.Analyzer
with a size > Math.pow(2, 10)
(1024), I'm faced with the following error:
IndexSizeError (DOM Exception 1): The index is not in the allowed range.
I've raised this issue on the ToneJS repository as well, but it seems like more of a bug in Safari, doesn't it?
Code
import Tone from 'tone';
const sampleSize = Math.pow(2, 13); // Math.pow(2, 10); works...
this.fft = new Tone.Analyser('fft', sampleSize);
this.panVol = new Tone.PanVol().fan(this.fft).toMaster();
Link to WebpackBin example
However, I couldn't find any information online regarding which browser supports which size, but the Tone.js documentation states that
the Value must be a power of two in the range 32 to 32768.
(Same as in the Web Audio API documentation)
Could it be that Safari's Audio APIs don't support larger sizes in getByteFrequencyData? I would like to use a very precise equalizer, but the sample size needs to be greater than 4000 for the lower frequencies.