Skip to content

Commit

Permalink
Document the sndhdr module.
Browse files Browse the repository at this point in the history
Document that the whatsound module is obsolete.
  • Loading branch information
freddrake committed Jan 5, 1999
1 parent a2e4017 commit 60adb36
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
1 change: 1 addition & 0 deletions Doc/lib/lib.tex
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ \chapter*{Front Matter\label{front}}
\input{libjpeg}
\input{librgbimg}
\input{libimghdr}
\input{libsndhdr}

\input{libcrypto} % Cryptographic Services
\input{libmd5}
Expand Down
52 changes: 52 additions & 0 deletions Doc/lib/libsndhdr.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\section{\module{sndhdr} ---
Determine type of sound file.}

\declaremodule{standard}{sndhdr}
\modulesynopsis{Determine type of a sound file.}
\sectionauthor{Fred L. Drake, Jr.}{[email protected]}
% Based on comments in the module source file.


The \module{sndhdr} provides utility functions which attempt to
determine the type of sound data which is in a file. When these
functions are able to determine what type of sound data is stored in a
file, they return a tuple \code{(\var{type}, \var{sampling_rate},
\var{channels}, \var{frames}, \var{bits_per_sample})}. The value for
\var{type} indicates the data type and will be one of the strings
\code{'aifc'}, \code{'aiff'}, \code{'au'}, \code{'hcom'},
\code{'sndr'}, \code{'sndt'}, \code{'voc'}, \code{'wav'},
\code{'8svx'}, \code{'sb'}, \code{'ub'}, or \code{'ul'}. The
\var{sampling_rate} will be either the actual value or \code{0} if
unknown or difficult to decode. Similarly, \var{channels} will be
either the number of channels or \code{0} if it cannot be determined
or if the value is difficult to decode. The value for \var{frames}
will be either the number of frames or \code{-1}. The last item in
the tuple, \var{bits_per_sample}, will either be the sample size in
bits or \code{'A'} for A-LAW\index{A-LAW} or \code{'U'} for
u-LAW\index{u-LAW}.


\begin{funcdesc}{what}{filename}
Determines the type of sound data stored in the file \var{filename}
using \function{whathdr()}. If not successful, \function{whatraw()}
is used. If neither attempt succeeds, returns \code{None},
otherwise it returns a tuple as described above.
\end{funcdesc}


\begin{funcdesc}{whathdr}{filename}
Determines the type of sound data stored in a file based on the file
header. The name of the file is given by \var{filename}. This
function returns a tuple as described above on success, or
\code{None}.
\end{funcdesc}


\begin{funcdesc}{whatraw}{filename}
Determines the type of raw sound data stored in a file without a
header. The name of the file is given by \var{filename}. This
function returns a tuple as described above on success, or
\code{None}.

This requires the \program{whatsound} program to work.
\end{funcdesc}
9 changes: 3 additions & 6 deletions Doc/lib/libundoc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,8 @@ \section{Multimedia}
\item[toaiff.py]
--- Convert "arbitrary" sound files to AIFF files

\item[sndhdr.py]
--- recognizing sound files

\item[wave.py]
--- parse WAVE files

\item[whatsound.py]
--- recognizing sound files
\end{description}


Expand Down Expand Up @@ -232,6 +226,9 @@ \section{Obsolete}
--- Measure time intervals to high resolution (use
\function{time.clock()} instead). (This is an extension module.)

\item[whatsound.py]
--- recognizing sound files

\item[zmod.py]
--- Compute properties of mathematical "fields"
\end{description}
Expand Down

0 comments on commit 60adb36

Please sign in to comment.