This should be something that is REALLY simple, but just isnt.
Setting the playbackRate without the Web Audio API works fine, at least in Firefox (where I am having trouble)...
Code: Select all
var audio = new Audio();
audio.src = 'some_stream.php?id=x'; // ID serves different files
audio.playbackRate = 0.5; // Controlled by a Range Input elsewhere on page
audio.play();
Code: Select all
aCtx = new (window.AudioContext || window.webkitAudioContext)();
audio_source = aCtx.createMediaElementSource(audio);
function setupGraph(){
graph.width = 222;
graph.height = 20;
ctx = graph.getContext('2d');
analyzer = aCtx.createAnalyser();
analyzer.fftSize = 256;
audio_source.connect(analyzer);
analyzer.connect(aCtx.destination);
graphAnimator();
}
This works in Chrome but not in Firefox? What am I doing wrong?