(audio,
                   n_fft=512,
                   hop_length=None,
                   mask=True,
                   log_mag=True,
                   re_im=False,
                   dphase=True,
                   mag_only=False)
return np.array(res)
Computes specgram in a batch.
Computes specgram in a batch.
Computes specgram in a batch .
def batch_specgram(audio,
                   n_fft=512,
                   hop_length=None,
                   mask=True,
                   log_mag=True,
                   re_im=False,
                   dphase=True,
                   mag_only=False):
  """Computes specgram in a batch."""
  assert len(audio.shape) == 2
  batch_size = audio.shape[0]
  res = []
  for b in range(batch_size):
    res.append(
        specgram(audio[b], n_fft, hop_length, mask, log_mag, re_im, dphase,
                 mag_only))
  return np.array(res)
def batch_specgram ( audio , n_fft = 512 , hop_length = None , mask = True , log_mag = True , re_im = False , dphase = True , mag_only = False ) : assert len ( audio . shape ) == 2 batch_size = audio . shape [ 0 ] res = [ ] for b in range ( batch_size ) : res . append ( specgram ( audio [ b ] , n_fft , hop_length , mask , log_mag , re_im , dphase , mag_only ) ) return np . array ( res )