选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
a ´i»ã@s2dZddgZddlmZeddƒZdej_dej_d ej_d ej_d ej _d d„Z d d„Z gZ dd„Z e  e ¡dd„Ze  e¡dd„Ze  e¡dd„Ze  e¡dd„Ze  e¡dd„Ze  e¡dd„Ze  e¡dd„Ze  e¡dd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zed*k�r.eƒd+S),a¶Routines to help recognizing sound files. Function whathdr() recognizes various types of sound file headers. It understands almost all headers that SOX can decode. The return tuple contains the following items, in this order: - file type (as SOX understands it) - sampling rate (0 if unknown or hard to decode) - number of channels (0 if unknown or hard to decode) - number of frames in the file (-1 if unknown or hard to decode) - number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW If the file doesn't have a recognizable type, it returns None. If the file can't be opened, OSError is raised. To compute the total time, divide the number of frames by the sampling rate (a frame contains a sample for each channel). Function what() calls whathdr(). (It used to also use some heuristics for raw data, but this doesn't work very well.) Finally, the function test() is a simple main program that calls what() for all files mentioned on the argument list. For directory arguments it calls what() for all files in that directory. Default argument is "." (testing all files in the current directory). The option -r tells it to recurse down directories found inside explicitly given directories. ÚwhatÚwhathdré)Ú namedtupleÚ SndHeadersz.filetype framerate nchannels nframes sampwidthz¡The value for type indicates the data type and will be one of the strings 'aifc', 'aiff', 'au','hcom', 'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be determined or if the value is difficult to decode.z?The value for frames will be either the number of frames or -1.zAEither the sample size in bits or 'A' for A-LAW or 'U' for u-LAW.cCs t|ƒ}|S)zGuess the type of a sound file.)r)ÚfilenameÚres©rú/usr/lib64/python3.9/sndhdr.pyr4scCslt|dƒ�N}| d¡}tD],}|||ƒ}|rt|ŽWdƒSqWdƒdS1s^0YdS)zRecognize sound headers.ÚrbiN)ÚopenÚreadÚtestsr)rÚfÚhZtfrrrr r:s   c Csžddl}| d¡sdS|dd…dkr,d}n|dd…dkrBd}ndS| d¡z| |d ¡}Wnt|jfyzYdS0|| ¡| ¡| ¡d|  ¡fS) NróFORMéé sAIFCÚaifcsAIFFZaiffÚr) rÚ startswithÚseekr ÚEOFErrorÚErrorÚ getframerateÚ getnchannelsÚ getnframesÚ getsampwidth)rrrÚfmtÚarrr Ú test_aifcKs   ÿrc CsÜ| d¡rt}n|dd…dvr&t}ndSd}||dd…ƒ}||dd…ƒ}||dd…ƒ}||dd…ƒ}||dd …ƒ}d } |d kr�d } n$|d kržd} n|d kr°d} d } nd} | |} | rÊ|| } nd} |||| | fS)Ns.sndé)sds.sdns.ZaurrééééÚUééú?éÿÿÿÿ)rÚ get_long_beÚ get_long_le) rrÚfuncÚfiletypeZhdr_sizeÚ data_sizeÚencodingÚrateÚ nchannelsZ sample_sizeZ sample_bitsÚ frame_sizeZnframerrr Útest_au`s2  r3cCsT|dd…dks |dd…dkr$dSt|dd…ƒ}|rBd |}nd }d |d d dfS)NéAéEsFSSDé€é„sHCOMé�é”i"VrZhcomr$r)r)r*)rrZdivisorr0rrr Ú test_hcom�s  r:cCst| d¡sdSt|dd…ƒ}d}d|kr6dkrfnn,||dkrfd||d}|rftd |ƒ}d |dd d fS) NsCreative Voice Filer"ériôr$ér g€„.AZvocr)r)rÚ get_short_leÚint)rrZsbseekr0Zratecoderrr Útest_vocŽs $ r?c CsŽddl}| d¡r2|dd…dks2|dd…dkr6dS| d¡z| |d¡}Wnt|jfyjYdS0d | ¡| ¡| ¡d|  ¡fS) NrsRIFFrrsWAVEr!sfmt rZwav) Úwaverrr rrrrrr)rrr@Úwrrr Útest_wavœs* ÿrBcCs"| d¡r|dd…dkrdSdS)Nrrrs8SVX)Z8svxrr$rr)r)rrrrr Ú test_8svx¬srCcCs<| d¡r8t|dd…ƒ}t|dd…ƒ}d|d|dfSdS)NsSOUNDrrr"r;Zsndtr$)rr+r=)rrZnsamplesr0rrr Ú test_sndtµs rDcCsD| d¡r@t|dd…ƒ}d|kr.dkr@nnd|ddd fSdS) Nsr&r i i¨aZsndrr$r)r)rr=)rrr0rrr Ú test_sndr¾s rEcCs,|dd>|dd>B|dd>B|dBS)Nrr#r$r!r&rr'r©Úbrrr r*Ësr*cCs,|dd>|dd>B|dd>B|dBS)Nr'r#r&r!r$rrrrFrrr r+Îsr+cCs|dd>|dBS)Nrrr$rrFrrr Ú get_short_beÑsrHcCs|dd>|dBS)Nr$rrrrFrrr r=Ôsr=cCsžddl}d}|jdd…r8|jddkr8|jdd…=d}z8|jdd…r`t|jdd…|dƒntdg|dƒWn(ty˜|j d¡| d¡Yn0dS)Nrr$z-rr&Ú.z [Interrupted] )ÚsysÚargvÚtestallÚKeyboardInterruptÚstderrÚwriteÚexit)rJÚ recursiverrr ÚtestÜs   rRc CsÊddl}ddl}|D]°}|j |¡r~t|ddd�|s<|rttdƒddl}| |j | |¡d¡¡}t||dƒqÄtdƒqt|ddd�|j   ¡ztt |ƒƒWqt yÂtd ƒYq0qdS) Nrz/:ú )Úendzrecursing down:Ú*z*** directory (use -r) ***ú:z*** not found ***) rJÚosÚpathÚisdirÚprintÚglobÚjoinÚescaperLÚstdoutÚflushrÚOSError)ÚlistrQZtoplevelrJrWrr[Únamesrrr rLës"    rLÚ__main__N)Ú__doc__Ú__all__Ú collectionsrrr-Z framerater1ZnframesZ sampwidthrrr rÚappendr3r:r?rBrCrDrEr*r+rHr=rRrLÚ__name__rrrr ÚsJ  ÿ