Back to index

python3.2  3.2.2
Public Member Functions | Private Attributes
aifc.Aifc_write Class Reference

List of all members.

Public Member Functions

def __init__
def initfp
def __del__
def aiff
def aifc
def setnchannels
def getnchannels
def setsampwidth
def getsampwidth
def setframerate
def getframerate
def setnframes
def getnframes
def setcomptype
def getcomptype
def getcompname

Private Attributes

 _aifc
 _file
 _version
 _comptype
 _compname
 _convert
 _nchannels
 _sampwidth
 _framerate
 _nframes
 _nframeswritten
 _datawritten
 _datalength
 _markers
 _marklength

Detailed Description

Definition at line 481 of file aifc.py.


Constructor & Destructor Documentation

def aifc.Aifc_write.__init__ (   self,
  f 
)

Definition at line 511 of file aifc.py.

00511 
00512     def __init__(self, f):
00513         if isinstance(f, str):
00514             filename = f
00515             f = builtins.open(f, 'wb')
00516         else:
00517             # else, assume it is an open file object already
00518             filename = '???'
00519         self.initfp(f)
00520         if filename[-5:] == '.aiff':
00521             self._aifc = 0
00522         else:
00523             self._aifc = 1

Here is the call graph for this function:

Here is the caller graph for this function:

def aifc.Aifc_write.__del__ (   self)

Definition at line 541 of file aifc.py.

00541 
00542     def __del__(self):
00543         if self._file:
00544             self.close()


Member Function Documentation

def aifc.Aifc_write.aifc (   self)

Definition at line 553 of file aifc.py.

00553 
00554     def aifc(self):
00555         if self._nframeswritten:
00556             raise Error('cannot change parameters after starting to write')
00557         self._aifc = 1

def aifc.Aifc_write.aiff (   self)

Definition at line 548 of file aifc.py.

00548 
00549     def aiff(self):
00550         if self._nframeswritten:
00551             raise Error('cannot change parameters after starting to write')
00552         self._aifc = 0

Definition at line 614 of file aifc.py.

00614 
00615     def getcompname(self):
00616         return self._compname

Definition at line 611 of file aifc.py.

00611 
00612     def getcomptype(self):
00613         return self._comptype

Definition at line 589 of file aifc.py.

00589 
00590     def getframerate(self):
00591         if not self._framerate:
00592             raise Error('frame rate not set')
00593         return self._framerate

Definition at line 565 of file aifc.py.

00565 
00566     def getnchannels(self):
00567         if not self._nchannels:
00568             raise Error('number of channels not set')
00569         return self._nchannels

Definition at line 599 of file aifc.py.

00599 
00600     def getnframes(self):
00601         return self._nframeswritten

Definition at line 577 of file aifc.py.

00577 
00578     def getsampwidth(self):
00579         if not self._sampwidth:
00580             raise Error('sample width not set')
00581         return self._sampwidth

def aifc.Aifc_write.initfp (   self,
  file 
)

Definition at line 524 of file aifc.py.

00524 
00525     def initfp(self, file):
00526         self._file = file
00527         self._version = _AIFC_version
00528         self._comptype = b'NONE'
00529         self._compname = b'not compressed'
00530         self._convert = None
00531         self._nchannels = 0
00532         self._sampwidth = 0
00533         self._framerate = 0
00534         self._nframes = 0
00535         self._nframeswritten = 0
00536         self._datawritten = 0
00537         self._datalength = 0
00538         self._markers = []
00539         self._marklength = 0
00540         self._aifc = 1      # AIFF-C is default

Here is the caller graph for this function:

def aifc.Aifc_write.setcomptype (   self,
  comptype,
  compname 
)

Definition at line 602 of file aifc.py.

00602 
00603     def setcomptype(self, comptype, compname):
00604         if self._nframeswritten:
00605             raise Error('cannot change parameters after starting to write')
00606         if comptype not in (b'NONE', b'ulaw', b'ULAW',
00607                             b'alaw', b'ALAW', b'G722'):
00608             raise Error('unsupported compression type')
00609         self._comptype = comptype
00610         self._compname = compname

def aifc.Aifc_write.setframerate (   self,
  framerate 
)

Definition at line 582 of file aifc.py.

00582 
00583     def setframerate(self, framerate):
00584         if self._nframeswritten:
00585             raise Error('cannot change parameters after starting to write')
00586         if framerate <= 0:
00587             raise Error('bad frame rate')
00588         self._framerate = framerate

def aifc.Aifc_write.setnchannels (   self,
  nchannels 
)

Definition at line 558 of file aifc.py.

00558 
00559     def setnchannels(self, nchannels):
00560         if self._nframeswritten:
00561             raise Error('cannot change parameters after starting to write')
00562         if nchannels < 1:
00563             raise Error('bad # of channels')
00564         self._nchannels = nchannels

def aifc.Aifc_write.setnframes (   self,
  nframes 
)

Definition at line 594 of file aifc.py.

00594 
00595     def setnframes(self, nframes):
00596         if self._nframeswritten:
00597             raise Error('cannot change parameters after starting to write')
00598         self._nframes = nframes

def aifc.Aifc_write.setsampwidth (   self,
  sampwidth 
)

Definition at line 570 of file aifc.py.

00570 
00571     def setsampwidth(self, sampwidth):
00572         if self._nframeswritten:
00573             raise Error('cannot change parameters after starting to write')
00574         if sampwidth < 1 or sampwidth > 4:
00575             raise Error('bad sample width')
00576         self._sampwidth = sampwidth


Member Data Documentation

Definition at line 520 of file aifc.py.

Definition at line 528 of file aifc.py.

Definition at line 527 of file aifc.py.

Definition at line 529 of file aifc.py.

Definition at line 536 of file aifc.py.

Definition at line 535 of file aifc.py.

Definition at line 525 of file aifc.py.

Definition at line 532 of file aifc.py.

Definition at line 537 of file aifc.py.

Definition at line 538 of file aifc.py.

Definition at line 530 of file aifc.py.

Definition at line 533 of file aifc.py.

Definition at line 534 of file aifc.py.

Definition at line 531 of file aifc.py.

Definition at line 526 of file aifc.py.


The documentation for this class was generated from the following file: