def __init__(self, tag='out', data_format=None): self.file = None if _swig_: if python2: # c function only knows utf-8 (ascii). translate the unicode tag = tag.encode('utf-8') self.file = c_rsf.sf_output(tag) else: self.file = _RSF(False, tag) if data_format: self.file.setformat(data_format) _File.__init__(self, tag)
def __init__(self,tag='out',src=None): if not tag: self.tag = Temp() self.temp = True else: self.tag = tag self.temp = False self.file = c_rsf.sf_output(self.tag) if src: # clone source file if hasattr(src,'file'): srcfile = src.file srctype = src.type else: srcfile = c_rsf.sf_input(self.tag) srctype = c_rsf.sf_gettype(srcfile) c_rsf.sf_settype(self.file,_File.type.index(srctype)) c_rsf.sf_fileflush(self.file,srcfile) _File.__init__(self,self.tag)