I'm creating an Electron app, and I want to intentially add a delay to the outgoing audio (Up to 10 seconds) in a webrtc call to simulate audio lagg.
I have tried using playoutDelayHint with WebRTC but it's very inconsistent. I want to be able to control the time delay very precisely.
audioReceiver.playoutDelayHint = 1;
audioReceiver.jitterBufferDelayHint = 1;
I have also tried using the AudioDelay node but it's not working, no delay at all.
let audioContext = new AudioContext();
let audioSource = audioContext.createMediaStreamSource(canvasStream);
let audioDestination = audioContext.createMediaStreamDestination();
let delay = audioContext.createDelay(3)
delay.connect(audioContext.destination);
Are there any other options or ways to make the options above work?