
    C1i                         % S SK r S SKr\ R                  S:X  a  SOSr\\S'   \" 5       r\R                  S\	R                  S\4S j5       r\R                   " S	 S
5      5       rg)    Nlittlelebecontainer_format_postfixc_formatreturnc                 >    U S:  a  g[        [        5      nXl        U$ )z2Get an AudioFormat without going through a string.r   N)AudioFormat_cinit_bypass_sentinel
sample_fmt)r   formats     I/home/james-whalen/.local/lib/python3.13/site-packages/av/audio/format.pyget_audio_formatr   	   s$     !|%&<=F M    c                       \ rS rSrSrS rS r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       r\S
 5       r\S 5       r\S 5       rSrg)r
      zDescriptor of audio formats.c                     U[         L a  g [        U[        5      (       a&  [        R                  " [        U5      R
                  nO[        R                  U5      nUS:  a  [        SU< 35      eX l        g )Nr   zNot a sample format: )	r   
isinstancer
   cythoncastr   libav_get_sample_fmt
ValueError)selfnamer   s      r   	__cinit__AudioFormat.__cinit__   sb    )) dK(([$7BBJ..t4J>4TH=>>$r   c                 "    SU R                    S3$ )Nz<av.AudioFormat >)r   r   s    r   __repr__AudioFormat.__repr__(   s    !$))A..r   c                 @    [         R                  U R                  5      $ )zKCanonical name of the sample format.

>>> AudioFormat('s16p').name
's16p'

)r   av_get_sample_fmt_namer   r    s    r   r   AudioFormat.name+   s     ))$//::r   c                 @    [         R                  U R                  5      $ )z>Number of bytes per sample.

>>> AudioFormat('s16p').bytes
2

r   av_get_bytes_per_sampler   r    s    r   bytesAudioFormat.bytes5   s     **4??;;r   c                 F    [         R                  U R                  5      S-  $ )z=Number of bits per sample.

>>> AudioFormat('s16p').bits
16

   r'   r    s    r   bitsAudioFormat.bits?   s     **4??;q@@r   c                 R    [        [        R                  U R                  5      5      $ )zCIs this a planar format?

Strictly opposite of :attr:`is_packed`.

)boolr   av_sample_fmt_is_planarr   r    s    r   	is_planarAudioFormat.is_planarI   s     C//@AAr   c                 J    [         R                  U R                  5      (       + $ )zCIs this a packed format?

Strictly opposite of :attr:`is_planar`.

)r   r1   r   r    s    r   	is_packedAudioFormat.is_packedR   s     ..t???r   c                 x    U R                   (       a  U $ [        [        R                  U R                  5      5      $ )zvThe planar variant of this format.

Is itself when planar:

>>> fmt = AudioFormat('s16p')
>>> fmt.planar is fmt
True

)r2   r   r   av_get_planar_sample_fmtr   r    s    r   planarAudioFormat.planar[   *     >>K < <T__ MNNr   c                 x    U R                   (       a  U $ [        [        R                  U R                  5      5      $ )zuThe packed variant of this format.

Is itself when packed:

>>> fmt = AudioFormat('s16')
>>> fmt.packed is fmt
True

)r5   r   r   av_get_packed_sample_fmtr   r    s    r   packedAudioFormat.packedj   r;   r   c                    U R                   (       a  [        S5      eU R                  [        R                  :X  a  gU R                  [        R
                  :X  a	  S[        -   $ U R                  [        R                  :X  a	  S[        -   $ U R                  [        R                  :X  a	  S[        -   $ U R                  [        R                  :X  a	  S[        -   $ [        S5      e)zThe name of a :class:`ContainerFormat` which directly accepts this data.

:raises ValueError: when planar, since there are no such containers.

zno planar container formatsu8s16s32f32f64zunknown layout)
r2   r   r   r   AV_SAMPLE_FMT_U8AV_SAMPLE_FMT_S16r   AV_SAMPLE_FMT_S32AV_SAMPLE_FMT_FLTAV_SAMPLE_FMT_DBLr    s    r   container_nameAudioFormat.container_namey   s     >>:;;??c222__ 5 55333__ 5 55333__ 5 55333__ 5 55333)**r   )r   N)__name__
__module____qualname____firstlineno____doc__r   r!   propertyr   r)   r-   r2   r5   r9   r>   rK   __static_attributes__ r   r   r
   r
      s    &%/ ; ; < < A A B B @ @ O O O O + +r   r
   )sysr   	byteorderr   str__annotations__objectr   cfuncr   AVSampleFormatr
   r   cclassrT   r   r   <module>r]      sw    
 (+(At # K  s11 k   x+ x+ x+r   