(wav_audio, hparams)
return spec
Return an op for converting wav audio to a spectrogram.
Return an op for converting wav audio to a spectrogram.
Return an op for converting wav audio to a spectrogram .
def wav_to_spec_op(wav_audio, hparams):
  """Return an op for converting wav audio to a spectrogram."""
  if hparams.spec_type == 'tflite_compat_mel':
    assert hparams.spec_log_amplitude
    spec = tflite_compat_mel(wav_audio, hparams=hparams)
  else:
    spec = tf.py_func(
        functools.partial(wav_to_spec, hparams=hparams),
        [wav_audio],
        tf.float32,
        name='wav_to_spec')
    spec.set_shape([None, hparams_frame_size(hparams)])
  return spec
def wav_to_spec_op ( wav_audio , hparams ) : if hparams . spec_type == 'tflite_compat_mel' : assert hparams . spec_log_amplitude spec = tflite_compat_mel ( wav_audio , hparams = hparams ) else : spec = tf . py_func ( functools . partial ( wav_to_spec , hparams = hparams ) , [ wav_audio ] , tf . float32 , name = 'wav_to_spec' ) spec . set_shape ( [ None , hparams_frame_size ( hparams ) ] ) return spec