(wav_file)
return waveform_to_examples(samples, sr)
Convenience wrapper around waveform_to_examples() for a common WAV format.

  Args:
    wav_file: String path to a file, or a file-like object. The file
    is assumed to contain WAV audio data with signed 16-bit PCM samples.

  Returns:
    See waveform_to_examples.
Convenience wrapper around waveform_to_examples() for a common WAV format.
Convenience wrapper around waveform_to_examples () for a common WAV format .
def wavfile_to_examples(wav_file):
  """Convenience wrapper around waveform_to_examples() for a common WAV format.

  Args:
    wav_file: String path to a file, or a file-like object. The file
    is assumed to contain WAV audio data with signed 16-bit PCM samples.

  Returns:
    See waveform_to_examples.
  """
  wav_data, sr = sf.read(wav_file, dtype='int16')
  assert wav_data.dtype == np.int16, 'Bad sample type: %r' % wav_data.dtype
  samples = wav_data / 32768.0  # Convert to [-1.0, +1.0]
  return waveform_to_examples(samples, sr)
def wavfile_to_examples ( wav_file ) : wav_data , sr = sf . read ( wav_file , dtype = 'int16' ) assert wav_data . dtype == np . int16 , 'Bad sample type: %r' % wav_data . dtype samples = wav_data / 32768.0 # Convert to [-1.0, +1.0] return waveform_to_examples ( samples , sr )