code: def semantic_to_waveform(
      semantic_tokens: np.ndarray,
      history_prompt: Optional[Union[Dict, str]] = None,
      temp: float = 0.7,
      silent: bool = False,
      output_full: bool = False,
  ):
      """Generate audio array from semantic input.
  
      Args:
          semantic_tokens: semantic token output from `text_to_semantic`
          history_prompt: history choice for audio cloning
          temp: generation temperature (1.0 more diverse, 0.0 more conservative)
          silent: disable progress bar
          output_full: return full generation to be used as a history prompt
  
      Returns:
          numpy audio array at sample frequency 24khz
      """
      coarse_tokens = generate_coarse(
          semantic_tokens,
          history_prompt=history_prompt,
          temp=temp,
          silent=silent,
          use_kv_caching=True,
      )
      fine_tokens = generate_fine(
          coarse_tokens,
          history_prompt=history_prompt,
          temp=0.5,
      )
      audio_arr = codec_decode(fine_tokens)
      if output_full:
          full_generation = {
              "semantic_prompt": semantic_tokens,
              "coarse_prompt": coarse_tokens,
              "fine_prompt": fine_tokens,
          }
          return full_generation, audio_arr
      return audio_arr
  
imports: from typing import Dict, Optional, Union
  import numpy
  from .generation import codec_decode, generate_coarse, generate_fine, generate_text_semantic
label_desc: Use image node_id 2 for calling a global function with example usage: semantic_to_waveform(semantic_tokens, history_prompt, temp, silent, output_full) and returns: audio_arr, full_generation,  audio_arr