import wave


def _GetWaveDurationSecs(wav_path):
  """Gets the duration in secs of the WAV file."""
  wav = wave.open(wav_path)
  try:
    return wav.getnframes() / (wav.getnchannels() * wav.getframerate())
  finally:
    wav.close()