Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \Æ~ã@s>dZddlZddlZddlZdddgZGdd„deƒZdZdd „Zd d „Z d d „Z dd„Z dd„Z dZ dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zdd!lmZdd"lmZed#d$ƒZd%ej_d&ej_d'ej_d(ej_d)ej_d*ej_Gd+d,„d,ƒZ Gd-d.„d.ƒZ!d@d/d„Z"e"Z#e$d0k�r:ddl%Z%e%j&d1d…�sHe%j&j'd2ƒe%j&d1Z(e"e(d3ƒ�ØZ)e*d4e(ƒe*d5e)j+ƒƒe*d6e)j,ƒƒe*d7e)j-ƒƒe*d8e)j.ƒƒe*d9e)j/ƒƒe*d:e)j0ƒƒe%j&d;d…�r0e%j&d;Z1e*dƒZ6e6�sPe2j7e6ƒ�qüWWdQRXe*d?ƒWdQRXdS)AaJStuff to parse AIFF-C and AIFF files. Unless explicitly stated otherwise, the description below is true both for AIFF-C files and AIFF files. An AIFF-C file has the following structure. +-----------------+ | FORM | +-----------------+ | | +----+------------+ | | AIFC | | +------------+ | | | | | . | | | . | | | . | +----+------------+ An AIFF file has the string "AIFF" instead of "AIFC". A chunk consists of an identifier (4 bytes) followed by a size (4 bytes, big endian order), followed by the data. The size field does not include the size of the 8 byte header. The following chunk types are recognized. FVER (AIFF-C only). MARK <# of markers> (2 bytes) list of markers: (2 bytes, must be > 0) (4 bytes) ("pstring") COMM <# of channels> (2 bytes) <# of sound frames> (4 bytes) (2 bytes) (10 bytes, IEEE 80-bit extended floating point) in AIFF-C files only: (4 bytes) ("pstring") SSND (4 bytes, not used by this program) (4 bytes, not used by this program) A pstring consists of 1 byte length, a string of characters, and 0 or 1 byte pad to make the total length even. Usage. Reading AIFF files: f = aifc.open(file, 'r') 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(). In some types of audio files, if the setpos() method is not used, the seek() method is not necessary. This returns an instance of a class with the following public methods: getnchannels() -- returns number of audio channels (1 for mono, 2 for stereo) getsampwidth() -- returns sample width in bytes getframerate() -- returns sampling frequency getnframes() -- returns number of audio frames getcomptype() -- returns compression type ('NONE' for AIFF files) getcompname() -- returns human-readable version of compression type ('not compressed' for AIFF files) getparams() -- returns a namedtuple consisting of all of the above in the above order getmarkers() -- get the list of marks in the audio file or None if there are no marks getmark(id) -- get mark with the specified id (raises an error if the mark does not exist) readframes(n) -- returns at most n frames of audio rewind() -- rewind to the beginning of the audio stream setpos(pos) -- seek to the specified position tell() -- return the current position close() -- close the instance (make it unusable) The position returned by tell(), the position given to setpos() and the position of marks are all compatible and have nothing to do with the actual position in the file. The close() method is called automatically when the class instance is destroyed. Writing AIFF files: f = aifc.open(file, 'w') 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(). This returns an instance of a class with the following public methods: aiff() -- create an AIFF file (AIFF-C default) aifc() -- create an AIFF-C file setnchannels(n) -- set the number of channels setsampwidth(n) -- set the sample width setframerate(n) -- set the frame rate setnframes(n) -- set the number of frames setcomptype(type, name) -- set the compression type and the human-readable compression type setparams(tuple) -- set all parameters at once setmark(id, pos, name) -- add specified mark to the list of marks tell() -- return current position in output file (useful in combination with setmark()) writeframesraw(data) -- write audio frames without pathing up the file header writeframes(data) -- write audio frames and patch up the file header close() -- patch up the file header and close the output file You should set the parameters before the first writeframesraw or writeframes. The total number of frames does not need to be set, but when it is set to the correct value, the header does not have to be patched up. It is best to first set all parameters, perhaps possibly the compression type, and then write audio frames using writeframesraw. When all frames have been written, either call writeframes(b'') or close() to patch up the sizes in the header. Marks can be added anytime. If there are any marks, you must call close() after all frames have been written. The close() method is called automatically when the class instance is destroyed. When a file is opened with the extension '.aiff', an AIFF file is written, otherwise an AIFF-C file is written. This default can be changed by calling aiff() or aifc() before the first writeframes or writeframesraw. éNÚErrorÚopenÚopenfpc@s eZdZdS)rN)Ú__name__Ú __module__Ú __qualname__©rrú/usr/lib64/python3.6/aifc.pyr�sl@QEc Cs6ytjd|jdƒƒdStjk r0t‚YnXdS)Nz>lér)ÚstructÚunpackÚreadÚerrorÚEOFError)Úfilerrr Ú _read_long”src Cs6ytjd|jdƒƒdStjk r0t‚YnXdS)Nz>Lr r)r r r rr)rrrr Ú _read_ulongšsrc Cs6ytjd|jdƒƒdStjk r0t‚YnXdS)Nz>hér)r r r rr)rrrr Ú _read_short src Cs6ytjd|jdƒƒdStjk r0t‚YnXdS)Nz>Hrr)r r r rr)rrrr Ú _read_ushort¦srcCs@t|jdƒƒ}|dkrd}n |j|ƒ}|d@dkr<|jdƒ}|S)Néró)Úordr )rÚlengthÚdataÚdummyrrr Ú _read_string¬s   rgâÿÿÿÿÿïcCs�t|ƒ}d}|dkr d }|d}t|ƒ}t|ƒ}||koL|koLdknrXd}n0|dkrft}n"|d}|d|td|d ƒ}||S) Nrri€giÿiÿ?lg@é?éÿÿÿÿ)rrÚ _HUGE_VALÚpow)ÚfÚexponÚsignÚhimantÚlomantrrr Ú _read_float¸s"r&cCs|jtjd|ƒƒdS)Nz>h)Úwriter Úpack)r!Úxrrr Ú _write_shortÉsr*cCs|jtjd|ƒƒdS)Nz>H)r'r r()r!r)rrr Ú _write_ushortÌsr+cCs|jtjd|ƒƒdS)Nz>l)r'r r()r!r)rrr Ú _write_longÏsr,cCs|jtjd|ƒƒdS)Nz>L)r'r r()r!r)rrr Ú _write_ulongÒsr-cCsRt|ƒdkrtdƒ‚|jtjdt|ƒƒƒ|j|ƒt|ƒd@dkrN|jdƒdS)Néÿz%string exceeds maximum pstring lengthÚBrró)ÚlenÚ ValueErrorr'r r()r!Úsrrr Ú _write_stringÕs   r4c Csúddl}|dkrd}|d}nd}|dkr8d}d}d}n |j|ƒ\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|j||ƒ}d}||B}|j|dƒ}|j|ƒ}t|ƒ}|j||dƒ}|j|ƒ}t|ƒ}t||ƒt||ƒt||ƒdS) Nri€ri@iÿiþ?é r)ÚmathZfrexpZldexpZfloorÚintr+r-) r!r)r6r#r"r$r%ZfmantZfsmantrrr Ú _write_floatÝs8       r8)ÚChunk)Ú namedtupleÚ _aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type ('not compressed' for AIFF files)c@sÐeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„ZdS)2Ú Aifc_readNc Cs<d|_d|_g|_d|_||_t|ƒ}|jƒdkr:tdƒ‚|jdƒ}|dkrTd|_ n|dkrdd|_ ntdƒ‚d|_ d|_ x¢d|_ yt|jƒ}Wnt k r¤PYnX|jƒ}|d krÈ|j|ƒd|_ nH|d krè||_ |jd ƒ}d|_ n(|d krüt|ƒ|_n|d k�r|j|ƒ|jƒqzW|j �s0|j �r8tdƒ‚dS)NrsFORMz file does not start with FORM idr sAIFFsAIFCrznot an AIFF or AIFF-C filesCOMMsSSNDésFVERsMARKz$COMM chunk and/or SSND chunk missing)Ú_versionÚ_convertÚ_markersÚ _soundposÚ_filer9Zgetnamerr Ú_aifcZ_comm_chunk_readÚ _ssnd_chunkÚ_ssnd_seek_neededrÚ_read_comm_chunkrÚ _readmarkÚskip)ÚselfrÚchunkZformdataZ chunknamerrrr Úinitfp4sJ        zAifc_read.initfpc CsLt|tƒr>tj|dƒ}y|j|ƒWqH|jƒ‚YqHXn |j|ƒdS)NÚrb)Ú isinstanceÚstrÚbuiltinsrrKÚclose)rIr!Ú file_objectrrr Ú__init__\s   zAifc_read.__init__cCs|S)Nr)rIrrr Ú __enter__hszAifc_read.__enter__cGs |jƒdS)N)rP)rIÚargsrrr Ú__exit__kszAifc_read.__exit__cCs|jS)N)rB)rIrrr ÚgetfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rErA)rIrrr ÚrewindtszAifc_read.rewindcCs |j}|dk rd|_|jƒdS)N)rBrP)rIrrrr rPxszAifc_read.closecCs|jS)N)rA)rIrrr Útell~szAifc_read.tellcCs|jS)N)Ú _nchannels)rIrrr Ú getnchannels�szAifc_read.getnchannelscCs|jS)N)Ú_nframes)rIrrr Ú getnframes„szAifc_read.getnframescCs|jS)N)Ú _sampwidth)rIrrr Ú getsampwidth‡szAifc_read.getsampwidthcCs|jS)N)Ú _framerate)rIrrr Ú getframerateŠszAifc_read.getframeratecCs|jS)N)Ú _comptype)rIrrr Ú getcomptype�szAifc_read.getcomptypecCs|jS)N)Ú _compname)rIrrr Ú getcompname�szAifc_read.getcompnamecCs*t|jƒ|jƒ|jƒ|jƒ|jƒ|jƒƒS)N)r;rZr^r`r\rbrd)rIrrr Ú getparams–s zAifc_read.getparamscCst|jƒdkrdS|jS)Nr)r1r@)rIrrr Ú getmarkers›szAifc_read.getmarkerscCs2x|jD]}||dkr|SqWtdj|ƒƒ‚dS)Nrzmarker {0!r} does not exist)r@rÚformat)rIÚidÚmarkerrrr Úgetmark s  zAifc_read.getmarkcCs*|dks||jkrtdƒ‚||_d|_dS)Nrzposition not in ranger)r[rrArE)rIÚposrrr Úsetpos¦szAifc_read.setposcCs–|jrD|jjdƒ|jjdƒ}|j|j}|r>|jj|dƒd|_|dkrPdS|jj||jƒ}|jrv|rv|j|ƒ}|jt|ƒ|j|j |_|S)Nrr=r) rErDÚseekr rAÚ _framesizer?r1rYr])rIÚnframesrrkrrrr Ú readframes¬s     zAifc_read.readframescCsddl}|j|dƒS)Nrr)ÚaudioopZalaw2lin)rIrrqrrr Ú _alaw2linÁszAifc_read._alaw2lincCsddl}|j|dƒS)Nrr)rqZulaw2lin)rIrrqrrr Ú _ulaw2linÅszAifc_read._ulaw2lincCs2ddl}t|dƒsd|_|j|d|jƒ\}|_|S)NrÚ _adpcmstater)rqÚhasattrrtZ adpcm2lin)rIrrqrrr Ú _adpcm2linÉs  zAifc_read._adpcm2lincCs.t|ƒ|_t|ƒ|_t|ƒdd|_tt|ƒƒ|_|j|j|_|j �rd}|j dkrld}t j dƒd|_ |j dƒ|_|rºt|jj dƒƒ}|d@dkr |d}|j ||_ |jjddƒt|ƒ|_|jd k�r*|jd krä|j|_n2|jdkrø|j|_n|jdk�r|j|_ntdƒ‚d|_n d |_d|_dS)Nér=rérzWarning: bad COMM chunk sizeér sNONEsG722óulawóULAWóalawóALAWzunsupported compression typersnot compressedr)rzr{)r|r})rrYrr[r]r7r&r_rnrCZ chunksizeÚwarningsÚwarnr rarrrmrrcrvr?rsrrr)rIrJZkludgerrrr rFÑs<               zAifc_read._read_comm_chunkc Csšt|ƒ}yHxBt|ƒD]6}t|ƒ}t|ƒ}t|ƒ}|s8|r|jj|||fƒqWWnDtk r”dt|jƒt|jƒdkr|dnd|f}tj |ƒYnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %srÚr3) rÚrangerrr@Úappendrr1r~r)rIrJZnmarkersÚirhrkÚnameÚwrrr rG÷szAifc_read._readmark)rrrrBrKrRrSrUrVrWrPrXrZr\r^r`rbrdrerfrjrlrprrrsrvrFrGrrrr r<s2$( &r<c@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Zd:d;„Z dd?„Z"d@dA„Z#dBdC„Z$dDdE„Z%dFdG„Z&dHdI„Z'dS)JÚ Aifc_writeNc Cs\t|tƒrNtj|dƒ}y|j|ƒWn|jƒ‚YnX|jdƒrXd|_n |j|ƒdS)NÚwbz.aiffr)rMrNrOrrKrPÚendswithrC)rIr!rQrrr rR+s   zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ g|_ d|_d|_dS)NsNONEsnot compressedrr)rBÚ _AIFC_versionr>rarcr?rYr]r_r[Ú_nframeswrittenÚ _datawrittenÚ _datalengthr@Ú _marklengthrC)rIrrrr rK;szAifc_write.initfpcCs |jƒdS)N)rP)rIrrr Ú__del__LszAifc_write.__del__cCs|S)Nr)rIrrr rSOszAifc_write.__enter__cGs |jƒdS)N)rP)rIrTrrr rURszAifc_write.__exit__cCs|jrtdƒ‚d|_dS)Nz0cannot change parameters after starting to writer)rŠrrC)rIrrr ÚaiffXszAifc_write.aiffcCs|jrtdƒ‚d|_dS)Nz0cannot change parameters after starting to writer)rŠrrC)rIrrr Úaifc]szAifc_write.aifccCs(|jrtdƒ‚|dkrtdƒ‚||_dS)Nz0cannot change parameters after starting to writerzbad # of channels)rŠrrY)rIÚ nchannelsrrr Ú setnchannelsbs zAifc_write.setnchannelscCs|jstdƒ‚|jS)Nznumber of channels not set)rYr)rIrrr rZiszAifc_write.getnchannelscCs0|jrtdƒ‚|dks|dkr&tdƒ‚||_dS)Nz0cannot change parameters after starting to writerr zbad sample width)rŠrr])rIÚ sampwidthrrr Ú setsampwidthns zAifc_write.setsampwidthcCs|jstdƒ‚|jS)Nzsample width not set)r]r)rIrrr r^uszAifc_write.getsampwidthcCs(|jrtdƒ‚|dkrtdƒ‚||_dS)Nz0cannot change parameters after starting to writerzbad frame rate)rŠrr_)rIÚ frameraterrr Ú setframeratezs zAifc_write.setframeratecCs|jstdƒ‚|jS)Nzframe rate not set)r_r)rIrrr r`�szAifc_write.getframeratecCs|jrtdƒ‚||_dS)Nz0cannot change parameters after starting to write)rŠrr[)rIrorrr Ú setnframes†szAifc_write.setnframescCs|jS)N)rŠ)rIrrr r\‹szAifc_write.getnframescCs.|jrtdƒ‚|d krtdƒ‚||_||_dS) Nz0cannot change parameters after starting to writeóNONEóulawóULAWóalawóALAWóG722zunsupported compression type)r˜r™ršr›rœr�)rŠrrarc)rIÚcomptypeÚcompnamerrr Ú setcomptypeŽszAifc_write.setcomptypecCs|jS)N)ra)rIrrr rb—szAifc_write.getcomptypecCs|jS)N)rc)rIrrr rdšszAifc_write.getcompnamecCsf|\}}}}}}|jrtdƒ‚|d kr.tdƒ‚|j|ƒ|j|ƒ|j|ƒ|j|ƒ|j||ƒdS) Nz0cannot change parameters after starting to writeóNONEóulawóULAWóalawóALAWóG722zunsupported compression type)r¡r¢r£r¤r¥r¦)rŠrr’r”r–r—r )rIZparamsr‘r“r•roržrŸrrr Ú setparams¢s    zAifc_write.setparamscCs>|j s|j s|j r tdƒ‚t|j|j|j|j|j|jƒS)Nznot all parameters set)rYr]r_rr;r[rarc)rIrrr re¯szAifc_write.getparamscCs†|dkrtdƒ‚|dkr tdƒ‚t|tƒs2tdƒ‚x 0zmarker position must be >= 0zmarker name must be bytes)rrMÚbytesr�r1r@r‚)rIrhrkr„rƒrrr Úsetmarkµs zAifc_write.setmarkcCs2x|jD]}||dkr|SqWtdj|ƒƒ‚dS)Nrzmarker {0!r} does not exist)r@rrg)rIrhrirrr rjÂs  zAifc_write.getmarkcCst|jƒdkrdS|jS)Nr)r1r@)rIrrr rfÈszAifc_write.getmarkerscCs|jS)N)rŠ)rIrrr rXÍszAifc_write.tellcCszt|ttfƒst|ƒjdƒ}|jt|ƒƒt|ƒ|j|j}|j rN|j |ƒ}|j j |ƒ|j ||_ |j t|ƒ|_ dS)Nr/)rMr¨Ú bytearrayÚ memoryviewÚcastÚ_ensure_header_writtenr1r]rYr?rBr'rŠr‹)rIrrorrr ÚwriteframesrawÐs   zAifc_write.writeframesrawcCs.|j|ƒ|j|jks"|j|jkr*|jƒdS)N)r®rŠr[rŒr‹Ú _patchheader)rIrrrr Ú writeframesÛs   zAifc_write.writeframesc CsŽ|jdkrdSz^|jdƒ|jd@r<|jjdƒ|jd|_|jƒ|j|jksb|j|jksb|jrj|j ƒWdd|_ |j}d|_|j ƒXdS)Nrrr0) rBr­r‹r'Ú _writemarkersrŠr[rŒr�r¯r?rP)rIr!rrr rPás         zAifc_write.closecCsddl}|j|dƒS)Nrr)rqZlin2alaw)rIrrqrrr Ú _lin2alawúszAifc_write._lin2alawcCsddl}|j|dƒS)Nrr)rqZlin2ulaw)rIrrqrrr Ú _lin2ulawþszAifc_write._lin2ulawcCs2ddl}t|dƒsd|_|j|d|jƒ\}|_|S)Nrrtr)rqrurtZ lin2adpcm)rIrrqrrr Ú _lin2adpcms  zAifc_write._lin2adpcmcCsf|jsb|jd kr.|jsd|_|jdkr.tdƒ‚|js|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)NsG722óulawóULAWóalawóALAW)r»r¼)r½r¾)rar´r?r³r²)rIrrr Ú_init_compressions      zAifc_write._init_compressioncCsL|jr|jdkr|jƒ|jjdƒ|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jrÊ|jdkrš|jd|_|jd@rÊ|jd|_n0|jd krÊ|jd d |_|jd@rÊ|jd|_y|jj ƒ|_ Wn t t fk �rúd|_ YnX|j |jƒ}|j�rD|jjd ƒ|jjd ƒt|jd ƒt|j|jƒn |jjdƒ|jjdƒt|j|ƒt|j|jƒ|j dk �rŽ|jj ƒ|_t|j|jƒ|jdk�r¶t|jdƒnt|j|jdƒt|j|jƒ|j�rú|jj|jƒt|j|jƒ|jjdƒ|j dk �r|jj ƒ|_t|j|jdƒt|jdƒt|jdƒdS)NsNONEsFORMróulawóULAWóalawóALAWróG722ér sAIFCsFVERsAIFFsCOMMr=sSSNDr)rÀrÁrÂrÃ)rÁrÀrÃrÂrÄ)rCrar¿rBr'r[rYr]rŒrXÚ_form_length_posÚAttributeErrorÚOSErrorÚ_write_form_lengthr-r>r*Ú _nframes_posr8r_r4rcÚ_ssnd_length_pos)rIZ initlengthÚ commlengthrrr rº!s^                        zAifc_write._write_headercCs\|jr*d t|jƒ}|d@r$|d}d}nd}d}t|jd||jd|d|ƒ|S) Nrxéré rr r=éry)rCr1rcr-rBr�)rIÚ datalengthrÌZ verslengthrrr rÉTs zAifc_write._write_form_lengthcCsÜ|jjƒ}|jd@r,|jd}|jjdƒn|j}||jkrd|j|jkrd|jdkrd|jj|dƒdS|jj|j dƒ|j |ƒ}|jj|j dƒt |j|jƒ|jj|j dƒt |j|dƒ|jj|dƒ|j|_||_dS)Nrr0rr=)rBrXr‹r'rŒr[rŠr�rmrÆrÉrÊr-rË)rIZcurposrÐrrrr r¯as&       zAifc_write._patchheadercCsÒt|jƒdkrdS|jjdƒd}xD|jD]:}|\}}}|t|ƒdd}t|ƒd@dkr*|d}q*Wt|j|ƒ|d|_t|jt|jƒƒx<|jD]2}|\}}}t|j|ƒt|j|ƒt|j|ƒq˜WdS)NrsMARKrrér=)r1r@rBr'r-r�r*r4)rIrrirhrkr„rrr r±ws"          zAifc_write._writemarkers)(rrrrBrRrKrŽrSrUr�r�r’rZr”r^r–r`r—r\r rbrdr§rer©rjrfrXr®r°rPr²r³r´r­r¿rºrÉr¯r±rrrr r† sJ    3 r†cCsJ|dkrt|dƒr|j}nd}|dkr.t|ƒS|dkr>t|ƒStdƒ‚dS) NÚmoderLÚrr…r‡z$mode must be 'r', 'rb', 'w', or 'wb')rÓrL)r…r‡)rurÒr<r†r)r!rÒrrr rŠs Ú__main__rz/usr/demos/data/audio/bach.aiffrÓZReadingz nchannels =z nframes =z sampwidth =z framerate =z comptype =z compname =rZWritingr…izDone.)N)8Ú__doc__r rOr~Ú__all__Ú Exceptionrr‰rrrrrrr&r*r+r,r-r4r8rJr9Ú collectionsr:r;r‘r“r•roržrŸr<r†rrrÚsysÚargvr‚Úfnr!ÚprintrZr\r^r`rbrdZgnÚgr§rerprr°rrrr Ú‡sz  !  ~