o
    lWiH                     @   s   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 e jd
ZG dd dZG dd dZdS )    N   )core)AsyncClientWrapperSyncClientWrapper)RequestOptions   )AsyncRawAudioIsolationClientRawAudioIsolationClient)&AudioIsolationConvertRequestFileFormat)%AudioIsolationStreamRequestFileFormat.c                   @      e Zd ZdefddZedefd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dZeddd	e	j
d
eje deje deje fddZdS )AudioIsolationClientclient_wrapperc                C      t |d| _d S N)r   )r	   _raw_clientselfr    r   e/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/audio_isolation/client.py__init__      zAudioIsolationClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawAudioIsolationClient
        r   r   r   r   r   with_raw_response      	z&AudioIsolationClient.with_raw_responseNfile_formatpreview_b_64request_optionsaudior   r    r!   c                c   sH    | j j||||d}|jE dH  W d   dS 1 sw   Y  dS )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!   rr   r   r   r%      s   "zAudioIsolationClient.convertr   r!   c                c   sF    | j j|||d}|jE dH  W d   dS 1 sw   Y  dS )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'   r   r   r   r+   B   s   "zAudioIsolationClient.stream)__name__
__module____qualname__r   r   propertyr	   r   OMITr   FiletypingOptionalr
   strr   Iteratorbytesr%   r   r+   r   r   r   r   r      s:    
'r   c                   @   r   )AsyncAudioIsolationClientr   c                C   r   r   )r   r   r   r   r   r   r   a   r   z"AsyncAudioIsolationClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawAudioIsolationClient
        r   r   r   r   r   r   d   r   z+AsyncAudioIsolationClient.with_raw_responseNr   r"   r   r    r!   c             	   C  sl   | j j||||d4 I dH }|j2 z	3 dH W }|V  q6 W d  I dH  dS 1 I dH s/w   Y  dS )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'   _chunkr   r   r   r%   o   s   .z!AsyncAudioIsolationClient.convertr(   c             	   C  sj   | j j|||d4 I dH }|j2 z	3 dH W }|V  q6 W d  I dH  dS 1 I dH s.w   Y  dS )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'   r8   r   r   r   r+      s   .z AsyncAudioIsolationClient.stream)r,   r-   r.   r   r   r/   r   r   r0   r   r1   r2   r3   r
   r4   r   AsyncIteratorr6   r%   r   r+   r   r   r   r   r7   `   s:    
(r7   )r2    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Anyr0   r   r7   r   r   r   r   <module>   s   P