o
    2j\                     @   s@   d dl Z d dlmZ d dlmZ e je jG dd deZdS )    N)
AudioFrame)Packetc                   @   sP   e Zd Zdd Zdd ZejddedB fddZejdd	e	dB fd
dZ
dS )AudioStreamc                 C   sp   | j d u rd| j dt| ddS | jr| jjnd }d| j d| j d| j d| jj d| d	t| ddS )
Nz<av.AudioStream #z audio/<nocodec> at 0xx> z at zHz, z, z at 0x)codec_contextindexidformatnameratelayout)selfform r   J/var/www/html/whisper/venv/lib/python3.10/site-packages/av/audio/stream.py__repr__	   s   
zAudioStream.__repr__c                 C   s2   | j d u rtdt| j d| dt| j |S )N'z' object has no attribute ')r   AttributeErrortype__name__getattr)r   r   r   r   r   __getattr__   s
   
zAudioStream.__getattr__Nframec                 C   s,   | j |}|D ]}| |_| jj|j_q|S )z
        Encode an :class:`.AudioFrame` and return a list of :class:`.Packet`.

        :rtype: list[Packet]

        .. seealso:: This is mostly a passthrough to :meth:`.CodecContext.encode`.
        )r   encode_streamptrr	   stream_index)r   r   packetspacketr   r   r   r      s
   
zAudioStream.encoder    c                 C   s   | j |S )z
        Decode a :class:`.Packet` and return a list of :class:`.AudioFrame`.

        :rtype: list[AudioFrame]

        .. seealso:: This is a passthrough to :meth:`.CodecContext.decode`.
        )r   decode)r   r    r   r   r   r!   +   s   
zAudioStream.decode)N)r   
__module____qualname__r   r   cythonccallr   r   r   r!   r   r   r   r   r      s    	r   )	r$   cython.cimports.av.audio.framer   cython.cimports.av.packetr   finalcclassStreamr   r   r   r   r   <module>   s    