Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_ossaudiodev.cpython-310.pyc
o

�9jJ�@s�ddlmZddlmZe�d�ddlmZe�d�ZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
zddlmZWneyQe	jdkrLejZnejZYnwd	d
�ZGdd�de
j�Zd
d�Zedkrme
��dSdS)�)�support)�
import_helper�audio)�findfile�ossaudiodevN)�AFMT_S16_NE�littlecCs�t|d��!}t�|�}|��}|��}|j}|�d�|��}Wd�n1s)wY|tjkr7td��t	�
|d�}||d|fS)N�rbrz)Expect .au file with 8-bit mu-law samples��)�open�sunau�getframerate�getnchannels�	_encoding�seek�read�AUDIO_FILE_ENCODING_MULAW_8�RuntimeError�audioop�ulaw2lin)�path�fp�au�rate�	nchannels�encoding�data�r�,/usr/lib/python3.10/test/test_ossaudiodev.py�read_sound_files


�
r c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�OSSAudioDevTestsc

Cs�zt�d�}Wn!ty(}z|jdtjtjtjtjfvr#t	�
|���d}~ww|��|��|�
�|��|��|�|j�|�|jd�|�|jdd|j�dD]}zt||d�WnttfylYqWw|�d|�qWtt|��|d||}|�t||�|�t|d	�d
k|�t� �}	|�!|�|�"�t� �}
|
|	}t||�|d}|�|dkd
||f�dS)N�wrz/dev/dspzbad dsp.mode: %r)�closed�name�mode�*zdsp.%s not read-only�g�G�z@g{�G�z�?�dg$@z2elapsed time (%s) > 10%% off of expected time (%s))#rr�OSError�args�errno�EACCES�ENOENT�ENODEV�EBUSY�unittest�SkipTest�bufsize�	obufcount�obuffree�getptr�fileno�assertFalser#�assertEqualr$r%�setattr�	TypeError�AttributeError�fail�float�len�
setparametersr�
assertTrue�abs�time�	monotonic�write�close)
�selfrr�ssizer�dsp�msg�attr�
expected_time�t1�t2�elapsed_time�percent_diffrrr�play_sound_file-sN�
���

��z OSSAudioDevTests.play_sound_filec	Cs�tjddf}tddf}||fD]}|\}}}|�|�|kr-|�|�|kr-|�|�|kr-nqtd��|�|||d�}|�||||fd||f�|�|||d�}|�||||fd||f�dS)	N�i@r
�D�zRunable to set audio sampling parameters: you must have really weird audio hardwareFzsetparameters%r: returned %rT)	r�AFMT_U8r�setfmt�channels�speedrr?r8)	rFrH�config1�config2�config�fmtrUr�resultrrr�set_parameters\s$

�
�
�zOSSAudioDevTests.set_parameterscCs�t}d}d}|d|f|d|f||dffD]9}|\}}}|�|||d�}|�||d�z
|�|||d�}WntjyG}zWYd}~qd}~ww|�d	�qdS)
NrRr
i,���i���Fz(unexpectedly got requested configurationTzexpected OSSAudioError)rr?�assertNotEqualr�
OSSAudioErrorr<)rFrHrZrrUrYr[�errrrr�set_bad_parameterszs(�
����z#OSSAudioDevTests.set_bad_parameterscCsttd��}|j|�dS)Nzaudiotest.au)r rrP)rF�
sound_inforrr�
test_playback�szOSSAudioDevTests.test_playbackc	CsFt�d�}z|�|�W|��|�|j�dS|��|�|j�w�Nr")rrr\rEr@r#�rFrHrrr�test_set_parameters�s
�z$OSSAudioDevTests.test_set_parameterscCs>t���}|�|��d�Wd�dS1swYdS)Nr)r�	openmixer�assertGreaterEqualr6)rF�mixerrrr�test_mixer_methods�s
"�z#OSSAudioDevTests.test_mixer_methodscCs:t�d��}Wd�n1swY|�|j�dSrd)rrr@r#rerrr�	test_with�s�zOSSAudioDevTests.test_withcCs�t�d�}|��|�t|j�|�t|jd�|�t|jd�|�t|jd�|�t|j	�|�t|j
�|�t|j
�|�t|j�|�t|j�t�
�}|��|�t|j�dS)Nr"rQ�x)rrrE�assertRaises�
ValueErrorr6rrD�writeallr2r3r4r5rg)rFrHrirrr�test_on_closed�s
zOSSAudioDevTests.test_on_closedN)�__name__�
__module__�__qualname__rPr\rarcrfrjrkrprrrrr!+s/r!c
Csdzt�d�}Wn$tjtfy+}z|jdtjtjtjtj	fvr&t
�|���d}~ww|��dS)Nr"r)
rr�errorr)r*r+r,r-r.r/r0r1rE)rHrIrrr�setUpModule�s�
��ru�__main__)�testr�test.supportr�requiresr�
import_modulerr+�sysr
rBrr0r�ImportError�	byteorder�AFMT_S16_LE�AFMT_S16_BEr �TestCaser!rurq�mainrrrr�<module>s4


��
�

Youez - 2016 - github.com/yon3zu
LinuXploit