import io
import wave


def get_wav_duration(wav_bytes: bytes) -> float:
    """Get the duration of a WAV file in seconds."""
    with io.BytesIO(wav_bytes) as wav_buffer:
        with wave.open(wav_buffer) as wav_file:
            frames = wav_file.getnframes()
            rate = wav_file.getframerate()
            return frames / float(rate)