def au_header(sample_rate, channels, bits_per_sample, total_pcm_frames):
    """given a set of integer stream attributes,
    returns header string of entire Au header

    may raise ValueError if the total size of the file is too large"""
    from audiotools.bitstream import build
    if channels * (bits_per_sample // 8) * total_pcm_frames >= 2 ** 32:
        raise ValueError('PCM data too large for Sun AU file')
    else:
        return build('4b 5*32u', False, (b'.snd', 24, channels * (
            bits_per_sample // 8) * total_pcm_frames, {(8): 2, (16): 3, (24
            ): 4}[bits_per_sample], sample_rate, channels))
