I am writing a visualizer for audio and am having an issue with safari on mac os x and on ios debugging with the remote debugger. On the animation function to update the AudioContext analyser the values in the ByteFrequency array are not updating on safari. Below is a sample of the code:
var context;
if (typeof AudioContext !== "undefined") {
context = new AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
context = new webkitAudioContext();
}
var analyser = context.createAnalyser();
analyser.fftSize = 64;
frequencyData = new Uint8Array(analyser.frequencyBinCount);
// Get the frequency data and update the visualisation
function update() {
requestAnimationFrame(update);
analyser.getByteFrequencyData(frequencyData);
};
$(document).ready(function(){
$("#player").bind('canplay', function() {
var source = context.createMediaElementSource(this);
source.connect(analyser);
analyser.connect(context.destination);
});
};
here is a link to the working example http://basketballjock.org/