Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libwave.tex @ 28646:193b8aec00ce legacy-trunk
Changes from Jonathan Riehl to allow his pgen extension (PEP 269) to
work. This includes some more code that used to be part of pgen in
the main parser; I'm okay with that. I'll see if the Windows build
needs work next.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Apr 2003 14:55:42 +0000 |
| parents | d7864345b1c8 |
| children | 4bbbe0c55fa2 |
| rev | line source |
|---|---|
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1 % Documentations stolen and LaTeX'ed from comments in file. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
2 \section{\module{wave} --- |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
3 Read and write WAV files} |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
4 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 \declaremodule{standard}{wave} |
|
15467
d7864345b1c8
Update Moshe Zadka's email address to one works and might last a while.
Fred Drake <fdrake@acm.org>
parents:
13625
diff
changeset
|
6 \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
7 \modulesynopsis{Provide an interface to the WAV sound format.} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
8 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
9 The \module{wave} module provides a convenient interface to the WAV sound |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
10 format. It does not support compression/decompression, but it does support |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
11 mono/stereo. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
12 |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
13 The \module{wave} module defines the following function and exception: |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
14 |
|
11613
68c259b6e6cd
Document that the |mode| parameter to open() is optional and explain how
Fred Drake <fdrake@acm.org>
parents:
11002
diff
changeset
|
15 \begin{funcdesc}{open}{file\optional{, mode}} |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
16 If \var{file} is a string, open the file by that name, other treat it |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
17 as a seekable file-like object. \var{mode} can be any of |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
18 \begin{description} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
19 \item[\code{'r'}, \code{'rb'}] Read only mode. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
20 \item[\code{'w'}, \code{'wb'}] Write only mode. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
21 \end{description} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
22 Note that it does not allow read/write WAV files. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
24 A \var{mode} of \code{'r'} or \code{'rb'} returns a \class{Wave_read} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 object, while a \var{mode} of \code{'w'} or \code{'wb'} returns |
|
11613
68c259b6e6cd
Document that the |mode| parameter to open() is optional and explain how
Fred Drake <fdrake@acm.org>
parents:
11002
diff
changeset
|
26 a \class{Wave_write} object. If \var{mode} is omitted and a file-like |
|
68c259b6e6cd
Document that the |mode| parameter to open() is optional and explain how
Fred Drake <fdrake@acm.org>
parents:
11002
diff
changeset
|
27 object is passed as \var{file}, \code{\var{file}.mode} is used as the |
|
68c259b6e6cd
Document that the |mode| parameter to open() is optional and explain how
Fred Drake <fdrake@acm.org>
parents:
11002
diff
changeset
|
28 default value for \var{mode} (the \character{b} flag is still added if |
|
68c259b6e6cd
Document that the |mode| parameter to open() is optional and explain how
Fred Drake <fdrake@acm.org>
parents:
11002
diff
changeset
|
29 necessary). |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
30 \end{funcdesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
31 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
32 \begin{funcdesc}{openfp}{file, mode} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
33 A synonym for \function{open()}, maintained for backwards compatibility. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
34 \end{funcdesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
35 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
36 \begin{excdesc}{Error} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
37 An error raised when something is impossible because it violates the |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
38 WAV specification or hits an implementation deficiency. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
39 \end{excdesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
40 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
41 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
42 \subsection{Wave_read Objects \label{Wave-read-objects}} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
43 |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
44 Wave_read objects, as returned by \function{open()}, have the |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
45 following methods: |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
46 |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
47 \begin{methoddesc}[Wave_read]{close}{} |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
48 Close the stream, and make the instance unusable. This is |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
49 called automatically on object collection. |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
50 \end{methoddesc} |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
51 |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
52 \begin{methoddesc}[Wave_read]{getnchannels}{} |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
53 Returns number of audio channels (\code{1} for mono, \code{2} for |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
54 stereo). |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
55 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
56 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
57 \begin{methoddesc}[Wave_read]{getsampwidth}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
58 Returns sample width in bytes. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
59 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
60 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
61 \begin{methoddesc}[Wave_read]{getframerate}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
62 Returns sampling frequency. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
63 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
64 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
65 \begin{methoddesc}[Wave_read]{getnframes}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
66 Returns number of audio frames. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
67 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
68 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
69 \begin{methoddesc}[Wave_read]{getcomptype}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
70 Returns compression type (\code{'NONE'} is the only supported type). |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
71 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
72 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
73 \begin{methoddesc}[Wave_read]{getcompname}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
74 Human-readable version of \method{getcomptype()}. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
75 Usually \code{'not compressed'} parallels \code{'NONE'}. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
76 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
77 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
78 \begin{methoddesc}[Wave_read]{getparams}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
79 Returns a tuple |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
80 \code{(\var{nchannels}, \var{sampwidth}, \var{framerate}, |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
81 \var{nframes}, \var{comptype}, \var{compname})}, equivalent to output |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
82 of the \method{get*()} methods. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
83 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
84 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
85 \begin{methoddesc}[Wave_read]{readframes}{n} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
86 Reads and returns at most \var{n} frames of audio, as a string of bytes. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
87 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
88 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
89 \begin{methoddesc}[Wave_read]{rewind}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
90 Rewind the file pointer to the beginning of the audio stream. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
91 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
92 |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
93 The following two methods are defined for compatibility with the |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
94 \refmodule{aifc} module, and don't do anything interesting. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
95 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
96 \begin{methoddesc}[Wave_read]{getmarkers}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
97 Returns \code{None}. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
98 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
99 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
100 \begin{methoddesc}[Wave_read]{getmark}{id} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
101 Raise an error. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
102 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
103 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
104 The following two methods define a term ``position'' which is compatible |
|
13625
fdfd1049f36e
Rob W. W. Hooft's spelling fixes for the Library Reference. I hope
Thomas Wouters <thomas@python.org>
parents:
11613
diff
changeset
|
105 between them, and is otherwise implementation dependent. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
106 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
107 \begin{methoddesc}[Wave_read]{setpos}{pos} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
108 Set the file pointer to the specified position. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
109 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
110 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
111 \begin{methoddesc}[Wave_read]{tell}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
112 Return current file pointer position. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
113 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
114 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
115 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
116 \subsection{Wave_write Objects \label{Wave-write-objects}} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
117 |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
118 Wave_write objects, as returned by \function{open()}, have the |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
119 following methods: |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
120 |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
121 \begin{methoddesc}[Wave_write]{close}{} |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
122 Make sure \var{nframes} is correct, and close the file. |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
123 This method is called upon deletion. |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
124 \end{methoddesc} |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
125 |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
126 \begin{methoddesc}[Wave_write]{setnchannels}{n} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
127 Set the number of channels. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
128 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
129 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
130 \begin{methoddesc}[Wave_write]{setsampwidth}{n} |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
131 Set the sample width to \var{n} bytes. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
132 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
133 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
134 \begin{methoddesc}[Wave_write]{setframerate}{n} |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
135 Set the frame rate to \var{n}. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
136 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
137 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
138 \begin{methoddesc}[Wave_write]{setnframes}{n} |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
139 Set the number of frames to \var{n}. This will be changed later if |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
140 more frames are written. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
141 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
142 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
143 \begin{methoddesc}[Wave_write]{setcomptype}{type, name} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
144 Set the compression type and description. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
145 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
146 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
147 \begin{methoddesc}[Wave_write]{setparams}{tuple} |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
148 The \var{tuple} should be \code{(\var{nchannels}, \var{sampwidth}, |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
149 \var{framerate}, \var{nframes}, \var{comptype}, \var{compname})}, with |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
150 values valid for the \method{set*()} methods. Sets all parameters. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
151 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
152 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
153 \begin{methoddesc}[Wave_write]{tell}{} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
154 Return current position in the file, with the same disclaimer for |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
155 the \method{Wave_read.tell()} and \method{Wave_read.setpos()} |
|
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
156 methods. |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
157 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
158 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
159 \begin{methoddesc}[Wave_write]{writeframesraw}{data} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
160 Write audio frames, without correcting \var{nframes}. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
161 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
162 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
163 \begin{methoddesc}[Wave_write]{writeframes}{data} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
164 Write audio frames and make sure \var{nframes} is correct. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
165 \end{methoddesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
166 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
167 Note that it is invalid to set any parameters after calling |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
168 \method{writeframes()} or \method{writeframesraw()}, and any attempt |
|
11002
e52723af3cd5
Small markup and English usage nits.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
169 to do so will raise \exception{wave.Error}. |
