HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/__pycache__/sndhdr.cpython-35.pyc


Fa@svdZddgZddlmZeddZddZddZgZd	d
Zej	eddZ
ej	e
d
dZej	eddZej	eddZ
ej	e
ddZej	eddZej	eddZej	eddZddZddZdd Zd!d"Zd#d$Zed%krred&S)'aRoutines 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.
whatwhathdr)
namedtuple
SndHeadersz.filetype framerate nchannels nframes sampwidthcCst|}|S)zGuess the type of a sound file.)r)filenameresr/usr/lib/python3.5/sndhdr.pyr(scCs`t|dJ}|jd}x-tD]%}|||}|r(t|Sq(WdSWdQRXdS)zRecognize sound headers.rbiN)openreadtestsr)rfhZtfrrrr	r.s
cCsddl}|jdsdS|dddkr>d}n#|dddkr]d}ndS|jdy|j|d	}Wnt|jfk
rdSYnX||j|j|jd|j	fS)
NrsFORMsAIFCaifcsAIFFZaiffr)
r
startswithseekrEOFErrorErrorgetframerategetnchannels
getnframesgetsampwidth)rrrZfmtarrr		test_aifc?s		
	rc
Cs6|jdrt}n#|dddkr7t}ndSd}||dd}||dd}||dd}||dd	}||d	d
}d}	|dkrd}
n6|d
krd}
n!|dkrd}
d
}	nd}
|	|}|r||}nd}|||||
fS)Ns.sndds.dns.ZaurrU?)rr )rget_long_beget_long_le)
rrfuncZfiletypeZhdr_sizeZ	data_sizeencodingrateZ	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	test_auTs2					

r/cCsr|dddks,|dddkr0dSt|dd}|rYd	|}nd
}d|ddd
fS)NAEsFSSDsHCOMi"VrZhcomr$rr))r*)rrZdivisorr.rrr		test_hcomus,
r6cCs|jdsdSt|dd}d}d|koFdknr||dkrd||d}|rtd	|}d
|dddfS)
NsCreative Voice Filer"rir$rg.AZvocrr))rget_short_leint)rrZsbseekr.Zratecoderrr	test_vocs,r;cCsddl}|jdsH|dddksH|dddkrLdS|jdy|j|d}Wnt|jfk
rdSYnXd	|j|j|jd|j	fS)
NrsRIFFrrsWAVEr!sfmt rZwav)
waverrZopenfprrrrrr)rrr<wrrr	test_wavs<
	r>cCs.|jds&|dddkr*dSdS)	NsFORMrrs8SVX8svxrr$)r?rr$rr)r)rrrrr		test_8svxs&r@cCsR|jdrNt|dd}t|dd}d|d|dfSdS)NsSOUNDrrr"r7Zsndtr$)rr+r9)rrZnsamplesr.rrr		test_sndtsrAcCsX|jdrTt|dd}d|ko<dknrTd|dd	dfSdS)
Nsr&riiaZsndrr$rr))rr9)rrr.rrr		test_sndrsrBcCs,|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$rrr)rCrrr	r+sr+cCs|dd>|dBS)Nrrr$r)rCrrr	get_short_besrDcCs|dd>|dBS)Nr$rrr)rCrrr	r9sr9cCsddl}d}|jddrN|jddkrN|jdd=d}yJ|jddrt|jdd|dntdg|dWn/tk
r|jjd|jdYnXdS)Nrr$z-rr&.z
[Interrupted]
)sysargvtestallKeyboardInterruptstderrwriteexit)rF	recursiverrr	tests& 
rNcCsddl}ddl}x|D]}|jj|rt|ddd|sW|rtdddl}|j|jj|d}t||dqtdqt|ddd|jj	ytt
|Wqtk
rtd	YqXqWdS)
Nrz/:end zrecursing down:*z*** directory (use -r) ***:z*** not found ***)rFospathisdirprintglobjoinrHstdoutflushrOSError)listrMZtoplevelrFrSrrWnamesrrr	rHs"




rH__main__N)__doc____all__collectionsrrrrr
rappendr/r6r;r>r@rArBr*r+rDr9rNrH__name__rrrr	<module>s>