code: def compute_energy(y: np.ndarray, **kwargs) -> np.ndarray:
      """Compute energy of a waveform using the same parameters used for computing melspectrogram.
      Args:
        x (np.ndarray): Waveform. Shape :math:`[T_wav,]`
      Returns:
        np.ndarray: energy. Shape :math:`[T_energy,]`. :math:`T_energy == T_wav / hop_length`
      Examples:
        >>> WAV_FILE = filename = librosa.example('vibeace')
        >>> from TTS.config import BaseAudioConfig
        >>> from TTS.utils.audio import AudioProcessor
        >>> conf = BaseAudioConfig()
        >>> ap = AudioProcessor(**conf)
        >>> wav = ap.load_wav(WAV_FILE, sr=ap.sample_rate)[:5 * ap.sample_rate]
        >>> energy = ap.compute_energy(wav)
      """
      x = stft(y=y, **kwargs)
      mag, _ = magphase(x)
      energy = np.sqrt(np.sum(mag**2, axis=0))
      return energy
  
imports: from io import BytesIO
  from typing import Tuple
  import librosa
  import numpy
  import scipy
  import soundfile
  from librosa import magphase, pyin
label_desc: Use image node_id 20 for calling a global function with example usage: compute_energy(y) and returns: energy