class_docstr: Base `Embedding` Manager class. Every new `Embedding` manager must inherit this.
  It defines common `Embedding` manager specific functions.
  
  It expects embeddings files in the following format:
  
  ::
  
      {
          'audio_file_key':{
              'name': 'category_name',
              'embedding'[<embedding_values>]
          },
          ...
      }
  
  `audio_file_key` is a unique key to the audio file in the dataset. It can be the path to the file or any other unique key.
  `embedding` is the embedding vector of the audio file.
  `name` can be name of the speaker of the audio file.
class_docstr_tok: ["Base","`","Embedding","`","Manager","class",".","Every","new","`","Embedding","`","manager","must","inherit","this",".","It","defines","common","`","Embedding","`","manager","specific","functions",".","It","expects","embeddings","files","in","the","following","format",":",":",":","{","'audio_file_key","'",":","{","'name","'",":","'category_name","'",",","'embedding","'","[","<","embedding_values",">","]","}",",","...","}","`","audio_file_key","`","is","a","unique","key","to","the","audio","file","in","the","dataset",".","It","can","be","the","path","to","the","file","or","any","other","unique","key",".","`","embedding","`","is","the","embedding","vector","of","the","audio","file",".","`","name","`","can","be","name","of","the","speaker","of","the","audio","file","."]
docstr: Compute a embedding from a given audio file.
  
  Args:
      wav_file (Union[str, List[str]]): Target file path.
  
  Returns:
      list: Computed embedding.
docstr_tok: ["Compute","a","embedding","from","a","given","audio","file",".","Args",":","wav_file","(","Union","[","str",",","List","[","str","]","]",")",":","Target","file","path",".","Returns",":","list",":","Computed","embedding","."]
code: def compute_embedding_from_clip(
      self, wav_file: Union[str, List[str]]
  ) -> list:
      """Compute a embedding from a given audio file.
  
      Args:
          wav_file (Union[str, List[str]]): Target file path.
  
      Returns:
          list: Computed embedding.
      """
  
      def _compute(wav_file: str):
          waveform = self.encoder_ap.load_wav(
              wav_file, sr=self.encoder_ap.sample_rate
          )
          if not self.encoder_config.model_params.get(
              "use_torch_spec", False
          ):
              m_input = self.encoder_ap.melspectrogram(waveform)
              m_input = torch.from_numpy(m_input)
          else:
              m_input = torch.from_numpy(waveform)
  
          if self.use_cuda:
              m_input = m_input.cuda()
          m_input = m_input.unsqueeze(0)
          embedding = self.encoder.compute_embedding(m_input)
          return embedding
  
      if isinstance(wav_file, list):
          # compute the mean embedding
          embeddings = None
          for wf in wav_file:
              embedding = _compute(wf)
              if embeddings is None:
                  embeddings = embedding
              else:
                  embeddings += embedding
          return (embeddings / len(wav_file))[0].tolist()
      embedding = _compute(wav_file)
      return embedding[0].tolist()
  
imports: import json
  import random
  from typing import Any, Dict, List, Tuple, Union
  import fsspec
  import numpy
  import torch
  from TTS.config import load_config
  from TTS.encoder.utils.generic_utils import setup_encoder_model
  from TTS.utils.audio import AudioProcessor
label_desc: Use image node_id 17 for calling the EmbeddingManager obj's underlying member method code with example usage: obj.compute_embedding_from_clip(wav_file) and returns: embedding, embedding, unknown