o
    lWi                     @   sT   d dl Z ddlmZmZ ddlmZ ddlmZmZ G dd dZ	G d	d
 d
Z
dS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions   )AsyncRawAudioClientRawAudioClientc                
   @   X   e Zd ZdefddZedefddZddd	ed
ede	j
e de	je fddZdS )AudioClientclient_wrapperc                C      t |d| _d S N)r   )r   _raw_clientselfr    r   c/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/dubbing/audio/client.py__init__      zAudioClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawAudioClient
        r   r   r   r   r   with_raw_response      	zAudioClient.with_raw_responseNrequest_options
dubbing_idlanguage_coder   c                c   sF    | j j|||d}|jE dH  W d   dS 1 sw   Y  dS )a  
        Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        language_code : str
            ID of the language.

        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]
            The dubbed audio or video file

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.audio.get(
            dubbing_id="dubbing_id",
            language_code="language_code",
        )
        r   Nr   getdata)r   r   r   r   rr   r   r   r       s   ""zAudioClient.get)__name__
__module____qualname__r   r   propertyr   r   strtypingOptionalr   Iteratorbytesr    r   r   r   r   r
   
       r
   c                
   @   r	   )AsyncAudioClientr   c                C   r   r   )r   r   r   r   r   r   r   @   r   zAsyncAudioClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawAudioClient
        r   r   r   r   r   r   C   r   z"AsyncAudioClient.with_raw_responseNr   r   r   r   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 )aI  
        Returns dub as a streamed MP3 or MP4 file. If this dub has been edited using Dubbing Studio you need to use the resource render endpoint as this endpoint only returns the original automatic dub result.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        language_code : str
            ID of the language.

        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]
            The dubbed audio or video file

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.audio.get(
                dubbing_id="dubbing_id",
                language_code="language_code",
            )


        asyncio.run(main())
        r   Nr   )r   r   r   r   r"   _chunkr   r   r   r    N   s   *.zAsyncAudioClient.get)r#   r$   r%   r   r   r&   r   r   r'   r(   r)   r   AsyncIteratorr+   r    r   r   r   r   r-   ?   r,   r-   )r(   core.client_wrapperr   r   core.request_optionsr   
raw_clientr   r   r
   r-   r   r   r   r   <module>   s   5