summaryrefslogtreecommitdiff
path: root/Lib/sunau.py
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1993-12-20 09:36:01 +0000
committerSjoerd Mullender <sjoerd@acm.org>1993-12-20 09:36:01 +0000
commit6aad98a081dfabf4340a080a4c599bbc7d8fa867 (patch)
tree43753b6d46997804d242768643f7fc45628e53cb /Lib/sunau.py
parent391a98bcedd1edc2d5b699a818b7db7371e0fefa (diff)
downloadcpython-6aad98a081dfabf4340a080a4c599bbc7d8fa867.tar.gz
aifc.py, sunau.py: Adapted comments; added access statements.
SUNAUDIODEV.py: Added some constants for Solaris.
Diffstat (limited to 'Lib/sunau.py')
-rw-r--r--Lib/sunau.py46
1 files changed, 26 insertions, 20 deletions
diff --git a/Lib/sunau.py b/Lib/sunau.py
index 08e4d208a2..00c2a28cbb 100644
--- a/Lib/sunau.py
+++ b/Lib/sunau.py
@@ -37,9 +37,7 @@
#
# Reading audio files:
# f = au.open(file, 'r')
-# or
-# f = au.openfp(filep, 'r')
-# where file is the name of a file and filep is an open file pointer.
+# where file is either the name of a file or an open file pointer.
# The open file pointer must have methods read(), seek(), and close().
# When the setpos() and rewind() methods are not used, the seek()
# method is not necessary.
@@ -72,9 +70,7 @@
#
# Writing audio files:
# f = au.open(file, 'w')
-# or
-# f = au.openfp(filep, 'w')
-# where file is the name of a file and filep is an open file pointer.
+# where file is either the name of a file or an open file pointer.
# The open file pointer must have methods write(), tell(), seek(), and
# close().
#
@@ -151,6 +147,20 @@ def _write_u32(file, x):
file.write(chr(int(data[i])))
class Au_read:
+ access _file, _soundpos, _hdr_size, _data_size, _encoding, \
+ _sampwidth, _framesize, _framerate, _nchannels, \
+ _framesize, _info: private
+
+ def __init__(self, f):
+ if type(f) == type(''):
+ import builtin
+ f = builtin.open(f, 'r')
+ self.initfp(f)
+
+ def __del__(self):
+ if self._file:
+ self.close()
+
def initfp(self, file):
self._file = file
self._soundpos = 0
@@ -193,16 +203,6 @@ class Au_read:
else:
self._info = ''
- def __init__(self, f):
- if type(f) == type(''):
- import builtin
- f = builtin.open(f, 'r')
- self.initfp(f)
-
- def __del__(self):
- if self._file:
- self.close()
-
def getfp(self):
return self._file
@@ -278,12 +278,20 @@ class Au_read:
self._file = None
class Au_write:
+ access _file, _framerate, _nchannels, _sampwidth, _framesize, \
+ _nframes, _nframeswritten, _datawritten, _info, \
+ _comptype: private
+
def __init__(self, f):
if type(f) == type(''):
import builtin
f = builtin.open(f, 'w')
self.initfp(f)
+ def __del__(self):
+ if self._file:
+ self.close()
+
def initfp(self, file):
self._file = file
self._framerate = 0
@@ -297,10 +305,6 @@ class Au_write:
self._info = ''
self._comptype = 'ULAW' # default is U-law
- def __del__(self):
- if self._file:
- self.close()
-
def setnchannels(self, nchannels):
if self._nframeswritten:
raise Error, 'cannot change parameters after starting to write'
@@ -404,6 +408,8 @@ class Au_write:
#
# private methods
#
+ access *: private
+
def _ensure_header_written(self):
if not self._nframeswritten:
if not self._nchannels: