code: def codecs(
      waveform,
      sample_rate: int,
      format: str,
      compression: Optional[float] = None,
      encoding: Optional[str] = None,
      bits_per_sample: Optional[int] = None,
  ):
      """Apply the specified codecs to the input signal.
  
      Warning: Wait until torchaudio 2.1 for this function to work.
  
      Note:
          1. This function only supports CPU backend.
          2. The GSM codec can be used to emulate phone line channel effects.
  
      Args:
          waveform (torch.Tensor): audio signal (..., time)
          sample_rate (int): sampling rate in Hz
          format (str): file format.
              Valid values are "wav", "mp3", "ogg", "vorbis", "amr-nb", "amb",
              "flac", "sph", "gsm", and "htk".
          compression (float or None, optional): used for formats other than WAV
  
              For more details see torchaudio.backend.sox_io_backend.save().
          encoding (str or None, optional): change the encoding for the supported formats
              Valid values are "PCM_S" (signed integer Linear PCM),
              "PCM_U" (unsigned integer Linear PCM), "PCM_F" (floating point PCM),
              "ULAW" (mu-law), and "ALAW" (a-law).
              For more details see torchaudio.backend.sox_io_backend.save().
          bits_per_sample (int or None, optional): change the bit depth
              for the supported formats
              For more details see torchaudio.backend.sox_io_backend.save().
  
      Returns:
          ret (torch.Tensor): compressed signal (..., time)
      """
      raise NotImplementedError
      ret = torchaudio.functional.apply_codec(
          waveform.unsqueeze(0),
          sample_rate,
          format,
          channels_first=False,
          compression=compression,
          encoding=encoding,
          bits_per_sample=bits_per_sample,
      )
      return ret.squeeze(0)
  
imports: import math
  import random
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torchaudio
label_desc: Use image node_id 11 for calling a global function with example usage: codecs(waveform, sample_rate, format, compression, encoding, bits_per_sample) and returns: ret