
    b6iH                         d dl Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	m
Z
 ddlmZ dd	lmZ  e j                  e j                   d
      Z G d d      Z G d d      Zy)    N   )core)AsyncClientWrapperSyncClientWrapper)RequestOptions   )AsyncRawAudioIsolationClientRawAudioIsolationClient)&AudioIsolationConvertRequestFileFormat)%AudioIsolationStreamRequestFileFormat.c                   R   e Zd ZdefdZedefd       Zeeddde	j                  dej                  e   d	ej                  e   d
ej                  e   dej                   e   f
dZeddde	j                  dej                  e   d
ej                  e   dej                   e   fdZy)AudioIsolationClientclient_wrapperc                &    t        |      | _        y N)r   )r
   _raw_clientselfr   s     l/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/audio_isolation/client.py__init__zAudioIsolationClient.__init__   s    2.Q    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawAudioIsolationClient
        r   r   s    r   with_raw_responsez&AudioIsolationClient.with_raw_response        r   Nfile_formatpreview_b_64request_optionsaudior   r    r!   c             #      K   | j                   j                  ||||      5 }|j                  E d{    ddd       y7 # 1 sw Y   yxY ww)a  
        Removes background noise from audio.

        Parameters
        ----------
        audio : core.File
            See core.File for more documentation

        file_format : typing.Optional[AudioIsolationConvertRequestFileFormat]
            The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.

        preview_b_64 : typing.Optional[str]
            Optional preview image base64 for tracking this generation.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.Iterator[bytes]
            Successful Response
        r"   r   r    r!   Nr   convertdata)r   r"   r   r    r!   rs         r   r&   zAudioIsolationClient.convert   sZ     < %%[|]l & 
 	vv	 	 	 	s+    AAA A	A AAAr   r!   c             #      K   | j                   j                  |||      5 }|j                  E d{    ddd       y7 # 1 sw Y   yxY ww)a/  
        Removes background noise from audio.

        Parameters
        ----------
        audio : core.File
            See core.File for more documentation

        file_format : typing.Optional[AudioIsolationStreamRequestFileFormat]
            The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.Iterator[bytes]
            Successful Response
        r"   r   r!   Nr   streamr'   )r   r"   r   r!   r(   s        r   r-   zAudioIsolationClient.streamB   sQ     4 $$5k[j$k 	opvv	 		 	s)   AA?A	AAA
A)__name__
__module____qualname__r   r   propertyr
   r   OMITr   FiletypingOptionalr   strr   Iteratorbytesr&   r   r-    r   r   r   r      s    R*; R  #:     PT-1;?! yy! __%KL	!
 ooc*!  8! 
	!N OS;? yy __%JK	
  8 
	r   r   c                   R   e Zd ZdefdZedefd       Zeeddde	j                  dej                  e   d	ej                  e   d
ej                  e   dej                   e   f
dZeddde	j                  dej                  e   d
ej                  e   dej                   e   fdZy)AsyncAudioIsolationClientr   c                &    t        |      | _        y r   )r	   r   r   s     r   r   z"AsyncAudioIsolationClient.__init__a   s    7~Vr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawAudioIsolationClient
        r   r   s    r   r   z+AsyncAudioIsolationClient.with_raw_responsed   r   r   Nr   r"   r   r    r!   c                  K   | j                   j                  ||||      4 d{   }|j                  2 3 d{   }| 7 7 6 ddd      d{  7   y# 1 d{  7  sw Y   yxY ww)a  
        Removes background noise from audio.

        Parameters
        ----------
        audio : core.File
            See core.File for more documentation

        file_format : typing.Optional[AudioIsolationConvertRequestFileFormat]
            The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.

        preview_b_64 : typing.Optional[str]
            Optional preview image base64 for tracking this generation.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.AsyncIterator[bytes]
            Successful Response
        r$   Nr%   )r   r"   r   r    r!   r(   _chunks          r   r&   z!AsyncAudioIsolationClient.converto   sw     < ##++[|]l , 
 	 	 !  f			 	 	 	 	sd   $A2AA2AA
AA
AA2A

AA2AA2A/#A&$A/+A2r)   c                  K   | j                   j                  |||      4 d{   }|j                  2 3 d{   }| 7 7 6 ddd      d{  7   y# 1 d{  7  sw Y   yxY ww)a4  
        Removes background noise from audio.

        Parameters
        ----------
        audio : core.File
            See core.File for more documentation

        file_format : typing.Optional[AudioIsolationStreamRequestFileFormat]
            The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.AsyncIterator[bytes]
            Successful Response
        r+   Nr,   )r   r"   r   r!   r(   r?   s         r   r-   z AsyncAudioIsolationClient.stream   sp     4 ##**Kap*q 	 	uv !  f		 	 	 	 	sd   #A1AA1AA	AA	AA1A		A
A1AA1A."A%#A.*A1)r.   r/   r0   r   r   r1   r	   r   r2   r   r3   r4   r5   r   r6   r   AsyncIteratorr8   r&   r   r-   r9   r   r   r;   r;   `   s    W*< W  #?     PT-1;?" yy" __%KL	"
 ooc*"  8" 
		e	$"P OS;? yy __%JK	
  8 
		e	$r   r;   )r4    r   core.client_wrapperr   r   core.request_optionsr   
raw_clientr	   r
   1types.audio_isolation_convert_request_file_formatr   0types.audio_isolation_stream_request_file_formatr   castAnyr2   r   r;   r9   r   r   <module>rJ      sM      G 1 M e c v{{6::s#M M`O Or   