summaryrefslogtreecommitdiffstats
path: root/Lib/sunau.py
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1993-12-20 09:36:01 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1993-12-20 09:36:01 (GMT)
commit2a45141741b385e21e6040815b2a2b72a1789568 (patch)
tree2ad83f497d7d6a11b39835d39db4790c5d89c463 /Lib/sunau.py
parent6ed9df264136007c654201ee58ca15f10124882a (diff)
downloadcpython-2a45141741b385e21e6040815b2a2b72a1789568.zip
cpython-2a45141741b385e21e6040815b2a2b72a1789568.tar.gz
cpython-2a45141741b385e21e6040815b2a2b72a1789568.tar.bz2
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 08e4d20..00c2a28 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: