Me gustaría preguntar si alguien podría ayudarme con la modulación en anillo usando javascript.
Aquí está mi código. No estoy seguro si estoy haciendo esto bien. En el botón de inicio, solo reproduce un oscilador con ganancia. Sin mezcla con archivo de audio.
Traté de hacer algo como esta fuente de GitHub
Gracias
function audioFileLoader(fileDirectory, impulseFileDirectory) { var audioContext = new AudioContext(); var soundObj = []; soundObj.fileDirectory = fileDirectory; soundObj.impulseFileDirectory = impulseFileDirectory; // buffer loader code var getSound = new XMLHttpRequest(); getSound.open("GET", soundObj.fileDirectory, true); getSound.responseType = "arraybuffer"; getSound.onload = function() { audioContext.decodeAudioData(getSound.response, function(buffer) { soundObj.soundToPlay = buffer; }); } getSound.send(); soundObj.play = function() { var source = audioContext.createBufferSource(); source.buffer = soundObj.soundToPlay; var oscillator = audioContext.createOscillator(); oscillator.type = 'sine'; oscillator.frequency.value = 500; var gainNode = audioContext.createGain(); gainNode.gain.value = 0.5; oscillator.connect(gainNode); source.connect(gainNode); gainNode.connect(audioContext.destination); oscillator.start(audioContext.currentTime); }; return soundObj; }; var example = audioFileLoader("audio/AcGtr.wav"); document.getElementById('ringmodulation').addEventListener("click", example.play, false);Su código nunca reproduce la fuente del búfer, falta source.start() . También var soundObj = [] debería ser var soundObj = {} .