def copy(wave_in, wave_out, sample_count, sample_bytes):
    """Copy samples between WAV objects."""
    b_size = 65536 // sample_bytes
    while sample_count:
        b = wave_in.readframes(min(b_size, sample_count))
        b_samples = len(b) // sample_bytes
        sample_count -= b_samples
        wave_out.writeframes(b)
