Your IP : 52.15.241.87


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/sndhdr.cpython-310.opt-2.pyc

o

6��f��@s2	ddgZddlmZedd�Zdej_dej_dej_d	ej_d
ej	_dd�Z
dd�ZgZd
d�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�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zed)kr�e�d*Sd*S)+�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)N)r)�filename�res�r�-/opt/alt/python310/lib64/python3.10/sndhdr.pyr4scCsp	t|d��(}|�d�}tD]}|||�}|r$t|�Wd�Sq	Wd�dS1s1wYdS)N�rbi)�open�read�testsr)r�f�hZtfrrrr	r:s


�$�c	Cs�ddl}|�d�sdS|dd�dkrd}n
|dd�dkr!d}ndS|�d�z|�|d	�}Wn
t|jfy=YdSw||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"

��rc
Cs�|�d�rt}n
|dd�dvrt}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
krHd}
n|dkrOd}
n|d
krXd}
d}	nd}
|	|}|re||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks|dd�dkrdSt|dd��}|r!d	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|krdkr3nn||dkr3d||d}|r3td	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r|dd�dks|dd�dkrdS|�d�z|�|d�}Wn
t|jfy5YdSwd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*
��r@cCs"|�d�r
|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�rt|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s

�rBcCsJ|�d�r!t|dd��}d|krdkr#ndSd|ddd	fSdSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
�rCcC�,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)��,r)cCrD)Nr&r"r%r r#rrrrErrr	r*�rGr*cC�|dd>|dBS)Nrrr#rrErrr	�get_short_be��rIcCrH)Nr#rrrrErrr	r;�rJr;cCs�ddl}d}|jdd�r|jddkr|jdd�=d}z|jdd�r2t|jdd�|d�WdStdg|d�WdStyP|j�d�|�d�YdSw)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rL�	recursiverrr	�test�s�rTc	Cs�ddl}ddl}|D]W}|j�|�r?t|ddd�|s|r:td�ddl}|�|j�|�|�d��}t||d�q
td�q
t|ddd�|j	�
�ztt|��Wq
tyatd	�Yq
wdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rL�os�path�isdir�print�glob�join�escaperN�stdout�flushr�OSError)�listrSZtoplevelrLrYrr]�namesrrr	rN�s&

��rN�__main__N)�__all__�collectionsrrr,�__doc__Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rIr;rTrN�__name__rrrr	�<module>sN �










�

?>