DRIVER=processor
MODALIAS=x86cpu:vendor:0000:family:000F:model:0006:feature:,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,001C,002B,0034,003D,0068,006F,0072,0074,0076,007D,0080,008D,0095,009F,00C0,00F3,00FD,0164,0165

 Ò    :mod:`sunau` --- Read and write Sun AU files
============================================

.. module:: sunau
   :synopsis: Provide an interface to the Sun AU sound format.
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>

**Source code:** :source:`Lib/sunau.py`

--------------

The :mod:`sunau` module provides a convenient interface to the Sun AU sound
format.  Note that this module is interface-compatible with the modules
:mod:`aifc` and :mod:`wave`.

An audio file consists of a header followed by the data.  The fields of the
header are:

+---------------+-----------------------------------------------+
| Field         | Contents                                      |
+===============+===============================================+
| magic word    | The four bytes ``.snd``.                      |
+---------------+-----------------------------------------------+
| header size   | Size of the header, including info, in bytes. |
+---------------+-----------------------------------------------+
| data size     | Physical size of the data, in bytes.          |
+---------------+-----------------------------------------------+
| encoding      | Indicates how the audio samples are encoded.  |
+---------------+-----------------------------------------------+
| sample rate   | The sampling rate.                            |
+---------------+-----------------------------------------------+
| # of channels | The number of channels in the samples.        |
+---------------+-----------------------------------------------+
| info          | ASCII string giving a description of the      |
|               | audio file (padded with null bytes).          |
+---------------+-----------------------------------------------+

Apart from the info field, all header fields are 4 bytes in size. They are all
32-bit unsigned integers encoded in big-endian byte order.

The :mod:`sunau` module defines the following functions:


.. function:: open(file, mode)

   If *file* is a string, open the file by that name, otherwise treat it as a
   seekable file-like object. *mode* can be any of

   ``'r'``
      Read only mode.

   ``'w'``
      Write only mode.

   Note that it does not allow read/write files.

   A *mode* of ``'r'`` returns a :class:`AU_read` object, while a *mode* of ``'w'``
   or ``'wb'`` returns a :class:`AU_write` object.


.. function:: openfp(file, mode)

   A synonym for :func:`.open`, maintained for backwards compatibility.


The :mod:`sunau` module defines the following exception:

.. exception:: Error

   An error raised when something is impossible because of Sun AU specs or
   implementation deficiency.


The :mod:`sunau` module defines the following data items:

.. data:: AUDIO_FILE_MAGIC

   An integer every valid Sun AU file begins with, stored in big-endian form.  This
   is the string ``.snd`` interpreted as an integer.


.. data:: AUDIO_FILE_ENCODING_MULAW_8
          AUDIO_FILE_ENCODING_LINEAR_8
          AUDIO_FILE_ENCODING_LINEAR_16
          AUDIO_FILE_ENCODING_LINEAR_24
          AUDIO_FILE_ENCODING_LINEAR_32
          AUDIO_FILE_ENCODING_ALAW_8

   Values of the encoding field from the AU header which are supported by this
   module.


.. data:: AUDIO_FILE_ENCODING_FLOAT
          AUDIO_FILE_ENCODING_DOUBLE
          AUDIO_FILE_ENCODING_ADPCM_G721
          AUDIO_FILE_ENCODING_ADPCM_G722
          AUDIO_FILE_ENCODING_ADPCM_G723_3
          AUDIO_FILE_ENCODING_ADPCM_G723_5

   Additional known values of the encoding field from the AU header, but which are
   not supported by this module.


.. _au-read-objects:

AU_read Objects
---------------

AU_read objects, as returned by :func:`.open` above, have the following methods:


.. method:: AU_read.close()

   Close the stream, and make the instance unusable. (This is  called 