code: def get_latent(
      speaker_wav,
      voice_cleanup=False,
      model=None,
      gpt_cond_len=30,
      max_ref_length=60,
      sr=24000,
  ):
      if model is None:
          model, supported_languages = get_xtt()
  
      if voice_cleanup:
          speaker_wav = filter_wave_1(speaker_wav)
          # speaker_wav = filter_wave_2(speaker_wav)
      else:
          speaker_wav = speaker_wav
  
      # create as function as we can populate here with voice cleanup/filtering
      # note diffusion_conditioning not used on hifigan (default mode), it will be empty but need to pass it to model.inference
      # latent = (gpt_cond_latent, speaker_embedding)
      latent = model.get_conditioning_latents(
          audio_path=speaker_wav,
          gpt_cond_len=gpt_cond_len,
          max_ref_length=max_ref_length,
          load_sr=sr,
      )
      return latent
  
imports: from __future__ import annotations
  import functools
  import io
  import os
  import tempfile
  import numpy
  import uuid
  import subprocess
  import time
  from src.tts_sentence_parsing import init_sentence_state, get_sentence, clean_sentence, detect_language
  from src.tts_utils import prepare_speech, get_no_audio, chunk_speed_change
  from src.utils import cuda_vis_check
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: get_latent(speaker_wav, voice_cleanup, model, gpt_cond_len, max_ref_length, sr) and returns: latent