Disable Audio Processing Dynamically

I’m using lib-jitsi-meet & I would like to disable audio processing under certain conditions. I’ve tried setting audio constraints in createLocalTracks()

const audioConstraints = {
    autoGainControl: false,
    channelCount: 2,
    echoCancellation: false,
    latency: 0,
    noiseSuppression: false,
    sampleRate: 48000,
    sampleSize: 16,
    volume: 1.0
}

but my constraints just get ignored.

The only way I’ve been able to turn off the audio processing is

JitsiMeetJS.init({disableAP: true});

Am I doing something wrong? Is it possible to set disableAP: true without reloading lib-jitsi-meet? How can I get my audio constraints to be used?

P.S. When I say turn off audio processing, I mean the browser processing, like echo cancellation for example

Others might correct me, but I think the intention is for these options to be set at the time JitsiMeetJS.init() is called. But if you don’t want the side effects of that, running just RTCUtils.init() might be sufficient. Note this API will not necessarily be supported in the future.

Thanks for the reply.

I found that I can get my constraints applied if I apply them after creating the local tracks

JitsiMeetJS.createLocalTracks(options)
.then(function(tracks){
	tracks.forEach(function(track){
		track.deviceLabel = track.track.label;

		if(track.type === 'audio'){
			const audioConstraints = track.track.getConstraints();

			audioConstraints.channelCount = 2;

			track.track.applyConstraints(audioConstraints)
			.then(function(result){
				console.log('%c' + 'Constraints are now', 'color:fuchsia;font-weight:bold;', track.track.getConstraints());
			});
		}
	});
})

but I’ll try rather just re-running init() as you suggest