AlkantarClanX12

Your IP : 18.217.161.27


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/sndhdr.cpython-312.opt-2.pyc

�

�Q�f���	ddlZejed��ddgZddlmZedd�Zd	ej_d
ej_dej_dej_d
ej_d�Z
d�ZgZd�Zej#e�d�Zej#e�d�Zej#e�d�Zej#e�d�Zej#e�d�Zej#e�d�Zej#e�d�Zej#e�d�Zd�Zd�Zd�Zd�Zd�Zedk(re�yy)�N)��
)�remove�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.c��	t|�}|S)N)r)�filename�ress  �-/opt/alt/python312/lib64/python3.12/sndhdr.pyrr8s��)�
�(�
�C��J�c��	t|d�5}|jd�}tD] }|||�}|s�t|�ccddd�S	ddd�y#1swYyxYw)N�rbi)�open�read�testsr	)r�f�h�tfrs     r
rr>s_��"�	
�h��	��
�F�F�3�K���B��Q��(�C��!�3�'�'�����
��	�	�s�&A�	A�A�Ac���	tj�5tjdt��ddl}ddd�|jd�sy|dddk(rd}n|ddd	k(rd
}ny|j
d�	j|d�}||j�|j�|j�d|j�zfS#1swY��xYw#tjf$rYywxYw)N�ignore)�categoryr�FORM��sAIFC�aifcsAIFF�aiff�r)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrr�fmt�as     r
�	test_aifcr.Os����	�	 �	 �	"����h�1C�D��
#�
�<�<�� ����2�w�'����	
�1�R��G�	�����F�F�1�I���I�I�a����
����!�1�>�>�#3�
�L�L�N�A���� 0�0�2�2�!
#�	"��
�d�j�j�!����s� C
�9C�
C�C1�0C1c�,�	|jd�rt}n|dddvrt}nyd}||dd�}||dd�}||dd�}||dd�}||dd	�}d
}	|d
k(rd}
n|dk(rd}
n|d
k(rd}
d}	nd}
|	|z}|r||z}nd}|||||
fS)Ns.snd�)sds.sdns.�aurr�����U�r�?���)r$�get_long_be�get_long_le)
rr�func�filetype�hdr_size�	data_size�encoding�rate�	nchannels�sample_size�sample_bits�
frame_size�nframes
             r
�test_aurGgs�����|�|�G����	
�2�A��%�	%�����H��A�a��F�|�H��Q�q��W�
�I��A�b��H�~�H���"�R��>�D��Q�r�"�X��I��K��1�}���	�Q����	�Q���������y�(�J���Z�'�����T�9�f�k�9�9rc�d�	|dddk7s|dddk7ryt|dd�}|rd	|z}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"Vr�hcomr5r9r)r:)rr�divisorrAs    r
�	test_hcomrQ�sU�����B�x�7��a��C�j�G�3���!�C��*�%�G���w������4��B��!�!rc��	|jd�syt|dd�}d}d|cxkrdkr&nn#||dk(rd||dzz
}|rtd	|z�}d
|dddfS)
NsCreative Voice Filer3�ri�r5�r0g��.A�vocr9r)r$�get_short_le�int)rr�sbseekrA�ratecodes     r
�test_vocrZ�sv����<�<�2�3��
�!�B�r�(�
#�F��D��F��S��Q�v�Y�!�^���6�!�8��$����y�8�+�,�D��$��2�q� � rc�R�	ddl}|jd�r|dddk7s|dddk7ry|jd�	|j|d�}d	|j
�|j�|j�d|j�zfS#t|j
f$rYywxYw)
NrsRIFFrrsWAVEr2sfmt r�wav)
�waver$r%rr&r'r(r)r*r+)rrr]�ws    r
�test_wavr_�s������<�<�� �A�a��G�w�$6�!�B�r�(�g�:M���F�F�1�I���I�I�a����
�1�>�>�#�Q�^�^�%5��<�<�>�1�Q�^�^�%5�#5�7�7��
�d�j�j�!����s�B�B&�%B&c�:�	|jd�r|dddk7ryy)Nrrrs8SVX)�8svxrr5rr)r$)rrs  r
�	test_8svxrb�s$����<�<�� �A�a��G�w�$6��rc�n�	|jd�r#t|dd�}t|dd�}d|d|dfSy)NsSOUNDrrr3rS�sndtr5)r$r;rV)rr�nsamplesrAs    r
�	test_sndtrf�sG����|�|�H���q��2�w�'���A�b��H�%���t�Q��!�+�+�rc�p�	|jd�r$t|dd�}d|cxkrdkr
nyd|ddd	fSyy)
Nsr7r0i�i�a�sndrr5r9r)r$rV)rrrAs   r
�	test_sndrri�sI����|�|�G���A�a��F�#���4� �5� ��4��B��)�)�!�rc�B�|ddz|ddzz|ddzz|dzS)Nrr4r5r2r7rr���bs r
r:r:��3��
�a�D�B�J�1�Q�4�2�:�&�!�A�$�!�)�4�q��t�;�;rc�B�|ddz|ddzz|ddzz|dzS)Nrr4r7r2r5rrrkrls r
r;r;�rnrc��|ddz|dzS)Nrrr5rkrls r
�get_short_berq����
�a�D�A�I��1���rc��|ddz|dzS)Nr5rrrkrls r
rVrV�rrrc�\�ddl}d}|jddr#|jddk(r|jdd�=d}	|jddrt|jdd|d�ytdg|d�y#t$r/|jjd�|j
d�YywxYw)Nrr5z-rr7�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rv�	recursives  r
�testr~�s�����I�
�x�x���|������t�+��H�H�Q�q�S�M��	���8�8�A�B�<��C�H�H�Q�R�L�)�Q�/��S�E�9�a�(�����
�
���,�-�������s�)A3�$A3�35B+�*B+c��ddl}ddl}|D]�}|jj|�rwt	|dzd��|s|rWt	d�ddl}|j|jj
|j|�d��}t||d���t	d���t	|dzd��|jj�	t	t|����y#t$rt	d	�Y��wxYw)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rv�os�path�isdir�print�glob�join�escaperx�stdout�flushr�OSError)�listr}�toplevelrvr�rr��namess        r
rxrx�s����
���
�7�7�=�=��"��(�T�/�s�+��H��'�(���	�	�"�'�'�,�,�t�{�{�8�/D�c�"J�K����y�!�,��2�3��(�S�.�c�*��J�J����
+��d�8�n�%����
+��)�*�
+�s�C"�"C9�8C9�__main__)r �_deprecated�__name__�__all__�collectionsrr	r=�__doc__�	frameraterB�nframes�	sampwidthrrrr.�appendrGrQrZr_rbrfrir:r;rqrVr~rxrkrr
�<module>r�sk���:�����X�g�.�
�9�
��"�
��H�J�
� >�
����!1�
����!6�
�����
����!#�
������	��2�*���Y��:�>���W��	"����Y��
!����X��7����X������Y��,����Y��*����Y��<�<���
�+�*�z���F�r