code: def load_voice(
      model, voice: str, extra_voice_dirs: List[str] = []
  ):  # pylint: disable=dangerous-default-value
      if voice == "random":
          return None, None, None
  
      voices = get_voices(extra_voice_dirs)
      paths = voices[voice]
  
      # bark only uses a single sample for cloning
      if len(paths) > 1:
          raise ValueError(f"Voice {voice} has multiple paths: {paths}")
  
      try:
          path = voices[voice]
      except KeyError as e:
          raise KeyError(
              f"Voice {voice} not found in {extra_voice_dirs}"
          ) from e
  
      if len(paths) == 1 and paths[0].endswith(".npz"):
          return load_npz(path[0])
  
      audio_path = paths[0]
      # replace the file extension with .npz
      output_path = os.path.splitext(audio_path)[0] + ".npz"
      generate_voice(
          audio=audio_path, model=model, output_path=output_path
      )
      return load_voice(model, voice, extra_voice_dirs)
  
imports: import logging
  import os
  import re
  from glob import glob
  from typing import Dict, List
  import librosa
  import numpy
  import torch
  import torchaudio
  import tqdm
  from encodec.utils import convert_audio
  from scipy.special import softmax
  from torch.nn import functional
  from TTS.tts.layers.bark.hubert.hubert_manager import HubertManager
  from TTS.tts.layers.bark.hubert.kmeans_hubert import CustomHubert
  from TTS.tts.layers.bark.hubert.tokenizer import HubertTokenizer
  from TTS.tts.layers.bark.load_model import clear_cuda_cache, inference_mode
label_desc: Use image node_id 6 for calling a global function with example usage: load_voice(model, voice, extra_voice_dirs) and returns: load_voice, None,  None,  None, load_npz