【发布时间】:2017-10-12 04:28:51
【问题描述】:
我目前在 Safari 10.1 中遇到了 Tone.Analyzer 的问题。
使用 size > Math.pow(2, 10) (1024) 初始化 Tone.Analyzer 时,出现以下错误:
IndexSizeError (DOM Exception 1): The index is not in the allowed range.
我也有submitted this to the ToneJS repository,但我觉得这更像是 Safari 中的一个错误,对吧?
代码
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();
但是,我在 interwebz 上找不到任何信息,哪个浏览器接受哪个尺寸,while the Tone.js documentation 提到,the Value must be a power of two in the range 32 to 32768. (Same as in the Web Audio API documentation)
Safaris 音频 API 的 getByteFrequencyData 是否没有实现更大的尺寸? 很想实现一个高精度的均衡器,但较低频率的样本大小需要 > 4000。
【问题讨论】:
标签: javascript safari web-audio-api