Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cdeb3e80
Commit
cdeb3e80
authored
Jun 17, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small markup and English usage nits.
parent
7588f2c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
Doc/lib/libwave.tex
Doc/lib/libwave.tex
+30
-29
No files found.
Doc/lib/libwave.tex
View file @
cdeb3e80
% Documentations stolen and LaTeX'ed from comments in file.
% Documentations stolen and LaTeX'ed from comments in file.
\section
{
\module
{
wave
}
---
\section
{
\module
{
wave
}
---
Read and write
.
WAV files
}
Read and write WAV files
}
\declaremodule
{
standard
}{
wave
}
\declaremodule
{
standard
}{
wave
}
\sectionauthor
{
Moshe Zadka
}{
mzadka@geocities.com
}
\sectionauthor
{
Moshe Zadka
}{
mzadka@geocities.com
}
...
@@ -10,7 +10,7 @@ The \module{wave} module provides a convenient interface to the WAV sound
...
@@ -10,7 +10,7 @@ The \module{wave} module provides a convenient interface to the WAV sound
format. It does not support compression/decompression, but it does support
format. It does not support compression/decompression, but it does support
mono/stereo.
mono/stereo.
The
\module
{
wave
}
module defines the following function:
The
\module
{
wave
}
module defines the following function
and exception
:
\begin{funcdesc}
{
open
}{
file, mode
}
\begin{funcdesc}
{
open
}{
file, mode
}
If
\var
{
file
}
is a string, open the file by that name, other treat it
If
\var
{
file
}
is a string, open the file by that name, other treat it
...
@@ -38,11 +38,17 @@ WAV specification or hits an implementation deficiency.
...
@@ -38,11 +38,17 @@ WAV specification or hits an implementation deficiency.
\subsection
{
Wave
_
read Objects
\label
{
Wave-read-objects
}}
\subsection
{
Wave
_
read Objects
\label
{
Wave-read-objects
}}
Wave
_
read objects, as returned by
\function
{
open()
}
above
, have the
Wave
_
read objects, as returned by
\function
{
open()
}
, have the
following methods:
following methods:
\begin{methoddesc}
[Wave
_
read]
{
close
}{}
Close the stream, and make the instance unusable. This is
called automatically on object collection.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
getnchannels
}{}
\begin{methoddesc}
[Wave
_
read]
{
getnchannels
}{}
Returns number of audio channels (1 for mone, 2 for stereo).
Returns number of audio channels (
\code
{
1
}
for mono,
\code
{
2
}
for
stereo).
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
getsampwidth
}{}
\begin{methoddesc}
[Wave
_
read]
{
getsampwidth
}{}
...
@@ -68,8 +74,9 @@ Usually \code{'not compressed'} parallels \code{'NONE'}.
...
@@ -68,8 +74,9 @@ Usually \code{'not compressed'} parallels \code{'NONE'}.
\begin{methoddesc}
[Wave
_
read]
{
getparams
}{}
\begin{methoddesc}
[Wave
_
read]
{
getparams
}{}
Returns a tuple
Returns a tuple
\code
{
(nchannels, sampwidth, framerate, nframes, comptype, compname)
}
,
\code
{
(
\var
{
nchannels
}
,
\var
{
sampwidth
}
,
\var
{
framerate
}
,
equivalent to output of the
\code
{
get
}
methods.
\var
{
nframes
}
,
\var
{
comptype
}
,
\var
{
compname
}
)
}
, equivalent to output
of the
\method
{
get*()
}
methods.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
readframes
}{
n
}
\begin{methoddesc}
[Wave
_
read]
{
readframes
}{
n
}
...
@@ -80,7 +87,7 @@ Reads and returns at most \var{n} frames of audio, as a string of bytes.
...
@@ -80,7 +87,7 @@ Reads and returns at most \var{n} frames of audio, as a string of bytes.
Rewind the file pointer to the beginning of the audio stream.
Rewind the file pointer to the beginning of the audio stream.
\end{methoddesc}
\end{methoddesc}
The following two
function
s are defined for compatibility with the
The following two
method
s are defined for compatibility with the
\refmodule
{
aifc
}
module, and don't do anything interesting.
\refmodule
{
aifc
}
module, and don't do anything interesting.
\begin{methoddesc}
[Wave
_
read]
{
getmarkers
}{}
\begin{methoddesc}
[Wave
_
read]
{
getmarkers
}{}
...
@@ -102,32 +109,32 @@ Set the file pointer to the specified position.
...
@@ -102,32 +109,32 @@ Set the file pointer to the specified position.
Return current file pointer position.
Return current file pointer position.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
read]
{
close
}{}
Close the stream, and make the instance unusable. (This is
called automatically on deletion.
\end{methoddesc}
\subsection
{
Wave
_
write Objects
\label
{
Wave-write-objects
}}
\subsection
{
Wave
_
write Objects
\label
{
Wave-write-objects
}}
Wave
_
write objects, as returned by
\function
{
open()
}
above
, have the
Wave
_
write objects, as returned by
\function
{
open()
}
, have the
following methods:
following methods:
\begin{methoddesc}
[Wave
_
write]
{
close
}{}
Make sure
\var
{
nframes
}
is correct, and close the file.
This method is called upon deletion.
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setnchannels
}{
n
}
\begin{methoddesc}
[Wave
_
write]
{
setnchannels
}{
n
}
Set the number of channels.
Set the number of channels.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setsampwidth
}{
n
}
\begin{methoddesc}
[Wave
_
write]
{
setsampwidth
}{
n
}
Set the sample width
(in bytes.)
Set the sample width
to
\var
{
n
}
bytes.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setframerate
}{
n
}
\begin{methoddesc}
[Wave
_
write]
{
setframerate
}{
n
}
Set the frame rate.
Set the frame rate
to
\var
{
n
}
.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setnframes
}{
n
}
\begin{methoddesc}
[Wave
_
write]
{
setnframes
}{
n
}
Set the number of frames
. This can be later changed, when and if more
Set the number of frames
to
\var
{
n
}
. This will be changed later if
frames are written.
more
frames are written.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setcomptype
}{
type, name
}
\begin{methoddesc}
[Wave
_
write]
{
setcomptype
}{
type, name
}
...
@@ -135,15 +142,15 @@ Set the compression type and description.
...
@@ -135,15 +142,15 @@ Set the compression type and description.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
setparams
}{
tuple
}
\begin{methoddesc}
[Wave
_
write]
{
setparams
}{
tuple
}
The
\var
{
tuple
}
should be
The
\var
{
tuple
}
should be
\code
{
(
\var
{
nchannels
}
,
\var
{
sampwidth
}
,
\code
{
(
\var
{
nchannels
}
,
\var
{
sampwidth
}
,
\var
{
framerate
}
,
\var
{
framerate
}
,
\var
{
nframes
}
,
\var
{
comptype
}
,
\var
{
compname
}
)
}
, with
\var
{
nframes
}
,
\var
{
comptype
}
,
\var
{
compname
}
)
}
, with values valid for
values valid for the
\method
{
set*()
}
methods. Sets all parameters.
the
\code
{
set
}
methods. Set all parameters.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
tell
}{}
\begin{methoddesc}
[Wave
_
write]
{
tell
}{}
Return current position in the file, with the same disclaimer for
Return current position in the file, with the same disclaimer for
the
\method
{
Wave
_
read.tell
}
and
\method
{
Wave
_
read.setpos
}
methods.
the
\method
{
Wave
_
read.tell()
}
and
\method
{
Wave
_
read.setpos()
}
methods.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
writeframesraw
}{
data
}
\begin{methoddesc}
[Wave
_
write]
{
writeframesraw
}{
data
}
...
@@ -154,12 +161,6 @@ Write audio frames, without correcting \var{nframes}.
...
@@ -154,12 +161,6 @@ Write audio frames, without correcting \var{nframes}.
Write audio frames and make sure
\var
{
nframes
}
is correct.
Write audio frames and make sure
\var
{
nframes
}
is correct.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[Wave
_
write]
{
close
}{}
Make sure
\var
{
nframes
}
is correct, and close the file.
This method is called upon deletion.
\end{methoddesc}
Note that it is invalid to set any parameters after calling
Note that it is invalid to set any parameters after calling
\method
{
writeframes()
}
or
\method
{
writeframesraw()
}
, and any attempt
\method
{
writeframes()
}
or
\method
{
writeframesraw()
}
, and any attempt
to do so will raise
an error
.
to do so will raise
\exception
{
wave.Error
}
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment