Back to index

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

List of all members.

Public Member Functions

def initfp
def __init__
def getfp
def rewind
def close
def tell
def getnchannels
def getnframes
def getsampwidth
def getframerate
def getcomptype
def getcompname

Private Attributes

 _version
 _convert
 _markers
 _soundpos
 _file
 _aifc
 _comm_chunk_read
 _ssnd_seek_needed
 _ssnd_chunk

Detailed Description

Definition at line 243 of file aifc.py.


Constructor & Destructor Documentation

def aifc.Aifc_read.__init__ (   self,
  f 
)

Definition at line 318 of file aifc.py.

00318 
00319     def __init__(self, f):
00320         if isinstance(f, str):
00321             f = builtins.open(f, 'rb')
00322         # else, assume it is an open file object already
00323         self.initfp(f)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def aifc.Aifc_read.close (   self)

Definition at line 334 of file aifc.py.

00334 
00335     def close(self):
00336         self._file.close()

Definition at line 355 of file aifc.py.

00355 
00356     def getcompname(self):
00357         return self._compname

Definition at line 352 of file aifc.py.

00352 
00353     def getcomptype(self):
00354         return self._comptype

def aifc.Aifc_read.getfp (   self)

Definition at line 327 of file aifc.py.

00327 
00328     def getfp(self):
00329         return self._file

Definition at line 349 of file aifc.py.

00349 
00350     def getframerate(self):
00351         return self._framerate

Definition at line 340 of file aifc.py.

00340 
00341     def getnchannels(self):
00342         return self._nchannels

def aifc.Aifc_read.getnframes (   self)

Definition at line 343 of file aifc.py.

00343 
00344     def getnframes(self):
00345         return self._nframes

Definition at line 346 of file aifc.py.

00346 
00347     def getsampwidth(self):
00348         return self._sampwidth

def aifc.Aifc_read.initfp (   self,
  file 
)

Definition at line 279 of file aifc.py.

00279 
00280     def initfp(self, file):
00281         self._version = 0
00282         self._convert = None
00283         self._markers = []
00284         self._soundpos = 0
00285         self._file = file
00286         chunk = Chunk(file)
00287         if chunk.getname() != b'FORM':
00288             raise Error('file does not start with FORM id')
00289         formdata = chunk.read(4)
00290         if formdata == b'AIFF':
00291             self._aifc = 0
00292         elif formdata == b'AIFC':
00293             self._aifc = 1
00294         else:
00295             raise Error('not an AIFF or AIFF-C file')
00296         self._comm_chunk_read = 0
00297         while 1:
00298             self._ssnd_seek_needed = 1
00299             try:
00300                 chunk = Chunk(self._file)
00301             except EOFError:
00302                 break
00303             chunkname = chunk.getname()
00304             if chunkname == b'COMM':
00305                 self._read_comm_chunk(chunk)
00306                 self._comm_chunk_read = 1
00307             elif chunkname == b'SSND':
00308                 self._ssnd_chunk = chunk
00309                 dummy = chunk.read(8)
00310                 self._ssnd_seek_needed = 0
00311             elif chunkname == b'FVER':
00312                 self._version = _read_ulong(chunk)
00313             elif chunkname == b'MARK':
00314                 self._readmark(chunk)
00315             chunk.skip()
00316         if not self._comm_chunk_read or not self._ssnd_chunk:
00317             raise Error('COMM chunk and/or SSND chunk missing')

Here is the caller graph for this function:

def aifc.Aifc_read.rewind (   self)

Definition at line 330 of file aifc.py.

00330 
00331     def rewind(self):
00332         self._ssnd_seek_needed = 1
00333         self._soundpos = 0

Here is the caller graph for this function:

def aifc.Aifc_read.tell (   self)

Definition at line 337 of file aifc.py.

00337 
00338     def tell(self):
00339         return self._soundpos


Member Data Documentation

Definition at line 290 of file aifc.py.

Definition at line 295 of file aifc.py.

Definition at line 281 of file aifc.py.

Definition at line 284 of file aifc.py.

Definition at line 282 of file aifc.py.

Definition at line 283 of file aifc.py.

Definition at line 307 of file aifc.py.

Definition at line 297 of file aifc.py.

Definition at line 280 of file aifc.py.


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