Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
Aifc_write Class Reference

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
 

Detailed Description

Definition at line 526 of file aifc.py.

Constructor & Destructor Documentation

def __init__ (   self,
  f 
)

Definition at line 556 of file aifc.py.

557  def __init__(self, f):
558  if type(f) == type(''):
559  filename = f
560  f = __builtin__.open(f, 'wb')
561  else:
562  # else, assume it is an open file object already
563  filename = '???'
564  self.initfp(f)
565  if filename[-5:] == '.aiff':
566  self._aifc = 0
567  else:
568  self._aifc = 1
def __del__ (   self)

Definition at line 587 of file aifc.py.

588  def __del__(self):
589  if self._file:
590  self.close()

Member Function Documentation

def aifc (   self)

Definition at line 599 of file aifc.py.

600  def aifc(self):
601  if self._nframeswritten:
602  raise Error, 'cannot change parameters after starting to write'
603  self._aifc = 1
def aiff (   self)

Definition at line 594 of file aifc.py.

595  def aiff(self):
596  if self._nframeswritten:
597  raise Error, 'cannot change parameters after starting to write'
598  self._aifc = 0
def getcompname (   self)

Definition at line 659 of file aifc.py.

660  def getcompname(self):
661  return self._compname
def getcomptype (   self)

Definition at line 656 of file aifc.py.

657  def getcomptype(self):
658  return self._comptype
def getframerate (   self)

Definition at line 635 of file aifc.py.

636  def getframerate(self):
637  if not self._framerate:
638  raise Error, 'frame rate not set'
639  return self._framerate
def getnchannels (   self)

Definition at line 611 of file aifc.py.

612  def getnchannels(self):
613  if not self._nchannels:
614  raise Error, 'number of channels not set'
615  return self._nchannels
def getnframes (   self)

Definition at line 645 of file aifc.py.

646  def getnframes(self):
647  return self._nframeswritten
def getsampwidth (   self)

Definition at line 623 of file aifc.py.

624  def getsampwidth(self):
625  if not self._sampwidth:
626  raise Error, 'sample width not set'
627  return self._sampwidth
def initfp (   self,
  file 
)

Definition at line 569 of file aifc.py.

570  def initfp(self, file):
571  self._file = file
572  self._version = _AIFC_version
573  self._comptype = 'NONE'
574  self._compname = 'not compressed'
575  self._comp = None
576  self._convert = None
577  self._nchannels = 0
578  self._sampwidth = 0
579  self._framerate = 0
580  self._nframes = 0
581  self._nframeswritten = 0
582  self._datawritten = 0
583  self._datalength = 0
584  self._markers = []
585  self._marklength = 0
586  self._aifc = 1 # AIFF-C is default
def setcomptype (   self,
  comptype,
  compname 
)

Definition at line 648 of file aifc.py.

649  def setcomptype(self, comptype, compname):
650  if self._nframeswritten:
651  raise Error, 'cannot change parameters after starting to write'
652  if comptype not in ('NONE', 'ULAW', 'ALAW', 'G722'):
653  raise Error, 'unsupported compression type'
654  self._comptype = comptype
655  self._compname = compname
def setframerate (   self,
  framerate 
)

Definition at line 628 of file aifc.py.

629  def setframerate(self, framerate):
630  if self._nframeswritten:
631  raise Error, 'cannot change parameters after starting to write'
632  if framerate <= 0:
633  raise Error, 'bad frame rate'
634  self._framerate = framerate
def setnchannels (   self,
  nchannels 
)

Definition at line 604 of file aifc.py.

605  def setnchannels(self, nchannels):
606  if self._nframeswritten:
607  raise Error, 'cannot change parameters after starting to write'
608  if nchannels < 1:
609  raise Error, 'bad # of channels'
610  self._nchannels = nchannels
def setnframes (   self,
  nframes 
)

Definition at line 640 of file aifc.py.

641  def setnframes(self, nframes):
642  if self._nframeswritten:
643  raise Error, 'cannot change parameters after starting to write'
644  self._nframes = nframes
def setsampwidth (   self,
  sampwidth 
)

Definition at line 616 of file aifc.py.

617  def setsampwidth(self, sampwidth):
618  if self._nframeswritten:
619  raise Error, 'cannot change parameters after starting to write'
620  if sampwidth < 1 or sampwidth > 4:
621  raise Error, 'bad sample width'
622  self._sampwidth = sampwidth

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