Open johneakin opened 5 years ago
Hi, I have added a button onto this quick start. I want to add a sound to the call when I click the button:
So far I have been unable to get this working:
document.getElementById('button-play').onclick = function () { var context = new (window.AudioContext || window.webkitAudioContext)(); var destination = context.createMediaStreamDestination(); var oscillator = context.createOscillator(); oscillator.type = 'sine'; oscillator.frequency.value = 440; oscillator.connect(destination); var mediaStreamTrack = destination.stream.getAudioTracks()[0]; conn.getLocalStream().addTrack(mediaStreamTrack); oscillator.start() };
Any help is appreciated thanks
Hi, I have added a button onto this quick start. I want to add a sound to the call when I click the button:
So far I have been unable to get this working:
document.getElementById('button-play').onclick = function () { var context = new (window.AudioContext || window.webkitAudioContext)(); var destination = context.createMediaStreamDestination(); var oscillator = context.createOscillator(); oscillator.type = 'sine'; oscillator.frequency.value = 440; oscillator.connect(destination); var mediaStreamTrack = destination.stream.getAudioTracks()[0]; conn.getLocalStream().addTrack(mediaStreamTrack);
oscillator.start() };
Any help is appreciated thanks