Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2bac87

Browse files
committed
Include more information from the docstrings.
1 parent 3a844a2 commit c2bac87

1 file changed

Lines changed: 49 additions & 7 deletions

File tree

Doc/lib/libsunau.tex

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,28 @@ \section{\module{sunau} ---
55
\sectionauthor{Moshe Zadka}{[email protected]}
66
\modulesynopsis{Provide an interface to the Sun AU sound format.}
77

8-
The \module{sunau} module provides a convenient interface to the Sun AU sound
9-
format. Note that this module is interface-compatible with the modules
10-
\refmodule{aifc} and \refmodule{wave}.
8+
The \module{sunau} module provides a convenient interface to the Sun
9+
AU sound format. Note that this module is interface-compatible with
10+
the modules \refmodule{aifc} and \refmodule{wave}.
11+
12+
An audio file consists of a header followed by the data. The fields
13+
of the header are:
14+
15+
\begin{tableii}{l|l}{textrm}{Field}{Contents}
16+
\lineii{magic word}{The four bytes \samp{.snd}.}
17+
\lineii{header size}{Size of the header, including info, in bytes.}
18+
\lineii{data size}{Physical size of the data, in bytes.}
19+
\lineii{encoding}{Indicates how the audio samples are encoded.}
20+
\lineii{sample rate}{The sampling rate.}
21+
\lineii{\# of channels}{The number of channels in the samples.}
22+
\lineii{info}{\ASCII{} string giving a description of the audio
23+
file (padded with null bytes).}
24+
\end{tableii}
25+
26+
Apart from the info field, all header fields are 4 bytes in size.
27+
They are all 32-bit unsigned integers encoded in big-endian byte
28+
order.
29+
1130

1231
The \module{sunau} module defines the following functions:
1332

@@ -36,10 +55,31 @@ \section{\module{sunau} ---
3655
implementation deficiency.
3756
\end{excdesc}
3857

39-
The \module{sunau} module defines the following data item:
58+
The \module{sunau} module defines the following data items:
4059

4160
\begin{datadesc}{AUDIO_FILE_MAGIC}
42-
An integer every valid Sun AU file begins with a big-endian encoding of.
61+
An integer every valid Sun AU file begins with, stored in big-endian
62+
form. This is the string \samp{.snd} interpreted as an integer.
63+
\end{datadesc}
64+
65+
\begin{datadesc}{AUDIO_FILE_ENCODING_MULAW_8}
66+
\dataline{AUDIO_FILE_ENCODING_LINEAR_8}
67+
\dataline{AUDIO_FILE_ENCODING_LINEAR_16}
68+
\dataline{AUDIO_FILE_ENCODING_LINEAR_24}
69+
\dataline{AUDIO_FILE_ENCODING_LINEAR_32}
70+
\dataline{AUDIO_FILE_ENCODING_ALAW_8}
71+
Values of the encoding field from the AU header which are supported by
72+
this module.
73+
\end{datadesc}
74+
75+
\begin{datadesc}{AUDIO_FILE_ENCODING_FLOAT}
76+
\dataline{AUDIO_FILE_ENCODING_DOUBLE}
77+
\dataline{AUDIO_FILE_ENCODING_ADPCM_G721}
78+
\dataline{AUDIO_FILE_ENCODING_ADPCM_G722}
79+
\dataline{AUDIO_FILE_ENCODING_ADPCM_G723_3}
80+
\dataline{AUDIO_FILE_ENCODING_ADPCM_G723_5}
81+
Additional known values of the encoding field from the AU header, but
82+
which are not supported by this module.
4383
\end{datadesc}
4484

4585

@@ -98,11 +138,13 @@ \subsection{AU_read Objects \label{au-read-objects}}
98138
between them, and is otherwise implementation dependent.
99139

100140
\begin{methoddesc}[AU_read]{setpos}{pos}
101-
Set the file pointer to the specified position.
141+
Set the file pointer to the specified position. Only values returned
142+
from \method{tell()} should be used for \var{pos}.
102143
\end{methoddesc}
103144

104145
\begin{methoddesc}[AU_read]{tell}{}
105-
Return current file pointer position.
146+
Return current file pointer position. Note that the returned value
147+
has nothing to do with the actual position in the file.
106148
\end{methoddesc}
107149

108150
The following two functions are defined for compatibility with the

0 commit comments

Comments
 (0)