function closeAudioContext({ audioSettings }, dispatch) {
  if (audioSettings.audioContext) audioSettings.audioContext.close();

  const payload = {
    rnnoise: null,
    noiseGate: null,
    equalizer: null,
    compressor: null,
    makeupGain: null,
    limiter: null,
    delay: null,
    analyser: null,
  };

  dispatch({
    type: 'UPDATE_AUDIO_SETTINGS',
    payload: { ...audioSettings, audioContext: null, echoTest: false },
  });
  dispatch({ type: 'UPDATE_AUDIO_NODES', payload: payload });
}
// Closes the AudioContext and resets all AudioNodes
Closes the AudioContext and resets all AudioNodes
Closes the AudioContext and resets all AudioNodes
function closeAudioContext({ audioSettings }, dispatch) {
  if (audioSettings.audioContext) audioSettings.audioContext.close();
  const payload = {
    rnnoise: null,
    noiseGate: null,
    equalizer: null,
    compressor: null,
    makeupGain: null,
    limiter: null,
    delay: null,
    analyser: null,
  };
  dispatch({
    type: 'UPDATE_AUDIO_SETTINGS',
    payload: { ...audioSettings, audioContext: null, echoTest: false },
  });
  dispatch({ type: 'UPDATE_AUDIO_NODES', payload: payload });
}
function closeAudioContext ( { audioSettings } , dispatch ) { if ( audioSettings . audioContext ) audioSettings . audioContext . close ( ) ; const payload = { rnnoise : null , noiseGate : null , equalizer : null , compressor : null , makeupGain : null , limiter : null , delay : null , analyser : null , } ; dispatch ( { type : 'UPDATE_AUDIO_SETTINGS' , payload : { ... audioSettings , audioContext : null , echoTest : false } , } ) ; dispatch ( { type : 'UPDATE_AUDIO_NODES' , payload : payload } ) ; }
Closes the AudioContext and resets all AudioNodes
Closes the AudioContext and resets all AudioNodes