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
d97b7b51
Commit
d97b7b51
authored
Jan 08, 2011
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10855: document close() semantics of wave objects.
parent
5254e970
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
Doc/library/wave.rst
Doc/library/wave.rst
+15
-9
No files found.
Doc/library/wave.rst
View file @
d97b7b51
...
...
@@ -14,8 +14,8 @@ The :mod:`wave` module defines the following function and exception:
.. function:: open(file, mode=None)
If *file* is a string, open the file by that name, other
treat it as a seekable
file-like object.
*mode* can be any of
If *file* is a string, open the file by that name, other
wise treat it as a
seekable file-like object.
*mode* can be any of
``'r'``, ``'rb'``
Read only mode.
...
...
@@ -26,9 +26,14 @@ The :mod:`wave` module defines the following function and exception:
Note that it does not allow read/write WAV files.
A *mode* of ``'r'`` or ``'rb'`` returns a :class:`Wave_read` object, while a
*mode* of ``'w'`` or ``'wb'`` returns a :class:`Wave_write` object. If *mode*
is omitted and a file-like object is passed as *file*, ``file.mode`` is used as
the default value for *mode* (the ``'b'`` flag is still added if necessary).
*mode* of ``'w'`` or ``'wb'`` returns a :class:`Wave_write` object. If
*mode* is omitted and a file-like object is passed as *file*, ``file.mode``
is used as the default value for *mode* (the ``'b'`` flag is still added if
necessary).
If you pass in a file-like object, the wave object will not close it when its
:meth:`close` method is called; it is the caller's responsibility to close
the file object.
.. function:: openfp(file, mode)
...
...
@@ -52,8 +57,8 @@ Wave_read objects, as returned by :func:`.open`, have the following methods:
.. method:: Wave_read.close()
Close the stream
, and make the instance unusable. This is called automatically
on object collection.
Close the stream
if it was opened by :mod:`wave`, and make the instance
unusable. This is called automatically
on object collection.
.. method:: Wave_read.getnchannels()
...
...
@@ -139,8 +144,8 @@ Wave_write objects, as returned by :func:`.open`, have the following methods:
.. method:: Wave_write.close()
Make sure *nframes* is correct, and close the file
. This method is called upon
dele
tion.
Make sure *nframes* is correct, and close the file
if it was opened by
:mod:`wave`. This method is called upon object collec
tion.
.. method:: Wave_write.setnchannels(n)
...
...
@@ -196,6 +201,7 @@ Wave_write objects, as returned by :func:`.open`, have the following methods:
Write audio frames and make sure *nframes* is correct.
Note that it is invalid to set any parameters after calling :meth:`writeframes`
or :meth:`writeframesraw`, and any attempt to do so will raise
:exc:`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