I've been playing around with web audio for about a week and found an article that discussed using a feedback loop with the delay node to make an echo effect. When adding the delay, it works perfectly for a single, one shot copy, but when adding in the two lines for linking the feedback (gain node) back into the delay node to create the looping echo effect no sound plays at all.
<html>
<body>
<script>
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
oscillator = audioCtx.createOscillator();
oscillator.type = 'sawtooth';
oscillator.frequency.value = 50;
var delay = audioCtx.createDelay();
delay.delayTime.value = 0.5;
var feedback = audioCtx.createGain();
feedback.gain.value = 0.8;
//delay.conncect(feedback);
//feedback.connect(delay);
oscillator.connect(delay);
oscillator.connect(audioCtx.destination);
delay.connect(audioCtx.destination);
oscillator.start();
</script>
</body>
</html>
Like this it works, but if you uncomment those two lines it breaks.
The article I was following is here: http://ift.tt/1kY3Odj
Also, as it might matter, I'm using Chrome Version 39.0.2171.95 m
Aucun commentaire:
Enregistrer un commentaire