const MIN_INTERRUPTION_DURATION_IN_S = 0.025 * 2;
const MAX_AUDIO_DURATION_IN_S = 3;
const AUDIO_PREFIX_DURATION_IN_S = 1;
const DETECTION_INTERVAL_IN_S = 0.1;
const REMOTE_INFERENCE_TIMEOUT_IN_S = 0.7;
const SAMPLE_RATE = 16e3;
const FRAMES_PER_SECOND = 40;
const FRAME_DURATION_IN_S = 0.025;
const apiConnectDefaults = {
  maxRetries: 3,
  retryInterval: 2e3,
  timeout: 1e4
};
function intervalForRetry(attempt, baseInterval = apiConnectDefaults.retryInterval) {
  const exponentialDelay = baseInterval * Math.pow(2, attempt);
  const jitter = exponentialDelay * Math.random() * 0.25;
  return exponentialDelay + jitter;
}
const interruptionOptionDefaults = {
  sampleRate: SAMPLE_RATE,
  minFrames: Math.ceil(MIN_INTERRUPTION_DURATION_IN_S * FRAMES_PER_SECOND),
  maxAudioDurationInS: MAX_AUDIO_DURATION_IN_S,
  audioPrefixDurationInS: AUDIO_PREFIX_DURATION_IN_S,
  detectionIntervalInS: DETECTION_INTERVAL_IN_S,
  inferenceTimeout: REMOTE_INFERENCE_TIMEOUT_IN_S * 1e3,
  minInterruptionDurationInS: MIN_INTERRUPTION_DURATION_IN_S
};
export {
  AUDIO_PREFIX_DURATION_IN_S,
  DETECTION_INTERVAL_IN_S,
  FRAMES_PER_SECOND,
  FRAME_DURATION_IN_S,
  MAX_AUDIO_DURATION_IN_S,
  MIN_INTERRUPTION_DURATION_IN_S,
  REMOTE_INFERENCE_TIMEOUT_IN_S,
  SAMPLE_RATE,
  apiConnectDefaults,
  interruptionOptionDefaults,
  intervalForRetry
};
//# sourceMappingURL=defaults.js.map