(wav_audio, frames_per_second)
return np.int32(w.getnframes() / w.getframerate() * frames_per_second)
Transforms a wav-encoded audio string into number of frames.
Transforms a wav-encoded audio string into number of frames.
Transforms a wav - encoded audio string into number of frames .
def wav_to_num_frames(wav_audio, frames_per_second):
  """Transforms a wav-encoded audio string into number of frames."""
  w = wave.open(io.BytesIO(wav_audio))
  return np.int32(w.getnframes() / w.getframerate() * frames_per_second)
def wav_to_num_frames ( wav_audio , frames_per_second ) : w = wave . open ( io . BytesIO ( wav_audio ) ) return np . int32 ( w . getnframes ( ) / w . getframerate ( ) * frames_per_second )