Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβ€”the ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβ€”embodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.🌌 SpectraShell

🌌 SpectraShell

Current path: lib64/python2.7/



⬆️ Go up: /lib64

πŸ“„ Viewing: sndhdr.pyo

οΏ½
zfc@s*dZddgZdοΏ½ZdοΏ½ZgZdοΏ½ZejeοΏ½dοΏ½ZejeοΏ½dοΏ½ZejeοΏ½dοΏ½Z	eje	οΏ½d	οΏ½Z
eje
οΏ½d
οΏ½ZejeοΏ½dοΏ½ZejeοΏ½dοΏ½Z
eje
οΏ½d
οΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½Zedkr&eοΏ½ndS(sοΏ½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, IOError 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.
twhattwhathdrcCst|οΏ½}|S(sGuess the type of a sound file(R(tfilenametres((s/usr/lib64/python2.7/sndhdr.pyR#scCsLt|dοΏ½}|jdοΏ½}x'tD]}|||οΏ½}|r%|Sq%WdS(sRecognize sound headerstrbiN(topentreadtteststNone(RtfthttfR((s/usr/lib64/python2.7/sndhdr.pyR)s
cCsοΏ½ddl}|d dkr dS|dd!dkr<d}n |dd!dkrXd	}ndS|jd
οΏ½y|j|dοΏ½}Wnt|jfk
rοΏ½dSX||jοΏ½|jοΏ½|jοΏ½d|j	οΏ½fS(NiοΏ½οΏ½οΏ½οΏ½itFORMiitAIFCtaifctAIFFtaiffitr(
RRtseektopenfptEOFErrortErrortgetframeratetgetnchannelst
getnframestgetsampwidth(R
R	Rtfmtta((s/usr/lib64/python2.7/sndhdr.pyt	test_aifc:s		
cCs
|d dkrt}n|d dkr2t}ndSd}||dd!οΏ½}||dd!οΏ½}||dd!οΏ½}||dd	!οΏ½}||d	d
!οΏ½}d}|dkrοΏ½d}	n6|d
krοΏ½d}	n!|dkrοΏ½d}	d
}nd}	||}
|||||
|	fS(Nis.sndsds.sdns.tauiiiiiitUiit?(sds.sdns.(tget_long_betget_long_leR(R
R	ttypethdr_sizet	data_sizetencodingtratet	nchannelstsample_sizetsample_bitst
frame_size((s/usr/lib64/python2.7/sndhdr.pyttest_auOs,					
cCsT|dd!dks&|dd!dkr*dSt|dd!οΏ½}d	d
|ddd
fS(NiAiEtFSSDiοΏ½iοΏ½tHCOMiithcomi"ViiοΏ½οΏ½οΏ½οΏ½iiοΏ½iοΏ½(RR (R
R	tdivisor((s/usr/lib64/python2.7/sndhdr.pyt	test_hcomls&cCsοΏ½|d dkrdSt|dd!οΏ½}d}d|koDdknrοΏ½||dkrοΏ½t||dοΏ½}tdd	|οΏ½}nd
|ddd
fS(NisCreative Voice FileiiiοΏ½sigοΏ½οΏ½.AitvociiοΏ½οΏ½οΏ½οΏ½i(Rtget_short_letordtint(R
R	tsbseekR&tratecode((s/usr/lib64/python2.7/sndhdr.pyttest_vocus,cCsοΏ½|d dks6|dd!dks6|dd!dkr:dSt|dd	!οΏ½}t|d	d
!οΏ½}t|d
d!οΏ½}t|dd
!οΏ½}d||d|fS(NitRIFFiitWAVEisfmt iiiii"i$twaviοΏ½οΏ½οΏ½οΏ½(RR2R!(R
R	tstyleR'R&R)((s/usr/lib64/python2.7/sndhdr.pyttest_wavοΏ½s6cCs+|d dks#|dd!dkr'dSd	S(
NiRiit8SVXt8svxii(R>iiii(R(R
R	((s/usr/lib64/python2.7/sndhdr.pyt	test_8svxοΏ½s#cCsM|d dkrIt|dd!οΏ½}t|dd!οΏ½}d|d|dfSdS(	NitSOUNDiiiitsndti(R!R2(R
R	tnsamplesR&((s/usr/lib64/python2.7/sndhdr.pyt	test_sndtοΏ½scCsY|d dkrUt|dd!οΏ½}d|ko:dknrUd|ddd	fSndS(
NisiiοΏ½iοΏ½atsndriiοΏ½οΏ½οΏ½οΏ½i(R2(R
R	R&((s/usr/lib64/python2.7/sndhdr.pyt	test_sndrοΏ½scCsDt|dοΏ½d>t|dοΏ½d>Bt|dοΏ½d>Bt|dοΏ½BS(Niiiiiii(R3(ts((s/usr/lib64/python2.7/sndhdr.pyR οΏ½scCsDt|dοΏ½d>t|dοΏ½d>Bt|dοΏ½d>Bt|dοΏ½BS(Niiiiiii(R3(RF((s/usr/lib64/python2.7/sndhdr.pyR!οΏ½scCs t|dοΏ½d>t|dοΏ½BS(Niii(R3(RF((s/usr/lib64/python2.7/sndhdr.pytget_short_beοΏ½scCs t|dοΏ½d>t|dοΏ½BS(Niii(R3(RF((s/usr/lib64/python2.7/sndhdr.pyR2οΏ½scCsοΏ½ddl}d}|jdrH|jddkrH|jdd5d}ny>|jdrrt|jd|dοΏ½ntdg|dοΏ½Wn.tk
rοΏ½|jjdοΏ½|jdοΏ½nXdS(NiοΏ½οΏ½οΏ½οΏ½iis-rit.s
[Interrupted]
(tsystargvttestalltKeyboardInterrupttstderrtwritetexit(RIt	recursive((s/usr/lib64/python2.7/sndhdr.pyttestοΏ½s 
	

cCsοΏ½ddl}ddl}xοΏ½|D]οΏ½}|jj|οΏ½rοΏ½|dG|sK|rοΏ½dGHddl}|j|jj|dοΏ½οΏ½}t||dοΏ½qοΏ½dGHq|dG|jjοΏ½yt	|οΏ½GHWqt
k
rοΏ½dGHqXqWdS(	NiοΏ½οΏ½οΏ½οΏ½s/:srecursing down:t*is*** directory (use -r) ***t:s*** not found ***(RItostpathtisdirtglobtjoinRKtstdouttflushRtIOError(tlistRPttoplevelRIRTRRWtnames((s/usr/lib64/python2.7/sndhdr.pyRKοΏ½s"


t__main__N(t__doc__t__all__RRRRtappendR+R0R7R<R?RCRER R!RGR2RQRKt__name__(((s/usr/lib64/python2.7/sndhdr.pyt<module>s8			
	
	
	

	

	
	
	
						


πŸ“