
    i              
       T   d Z ddlZddlZddlmZmZmZmZ ddl	m
Z
 ej                  j                  dddd        ej                           ed	      Z ee       g Zg Zd
 Zd Z e
e        eed   d	deddee      Zej+                  d        ee        eded    d        ej,                  d        ed       ej                  j/                  dj1                  e            Z ed       ej5                           ej,                  d        ej6                          y)zw pygame.examples.audiocapture

A pygame 2 experiment.

* record sound from a microphone
* play back the recorded sound
    N)get_audio_device_namesAudioDevice	AUDIO_F32AUDIO_ALLOW_FORMAT_CHANGE)set_post_mixiD         i   Tc                 @    t         j                  t        |             y)ztThis is called in the sound thread.

    Note, that the frequency and such you request may not be what you get.
    N)sound_chunksappendbytes)audiodeviceaudiomemoryviews     f/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/pygame/examples/audiocapture.pycallbackr       s     o./    c                 V    t        t        |      t        |             t        |        y)zTThis is called in the sound thread.

    At the end of mixing we get this data.
    N)printtypelen)postmixr   s     r   postmix_callbackr   *   s    
 
$
_!56	'Nr   )
devicename	iscapture	frequencyaudioformatnumchannels	chunksizeallowed_changesr   zrecording with ''   z"Turning data into a pg.mixer.Soundr   )bufferzplaying back recorded sound)__doc__pygamepgtimepygame._sdl2r   r   r   r   pygame._sdl2.mixerr   mixerpre_initinitnamesr   soundsr   r   r   audiopausesleepSoundjoinsoundplayquit r   r   <module>r7      s'      ,   %Q $ 	 	t$ e	0  Qx-		 A e q
!$ % 


1 * +
chh|45 # $ 

 


1 	r   