+
    Wi                         R t ^ RIt^ RIt^ RIHtHtHt ^ RIt^ RIt^ RI	H
t
 ^RIHtHtHt ^RIHt ^RIHtHtHt ]P(                  ! ]P*                  ! 4       R7      tR R	 ltR
RRR/R R llt ! R R4      tR# )z|This module contains functions to list all available voices and a class to find the
correct voice based on their attributes.N)AnyListOptional)Unpack)SEC_MS_GEC_VERSIONVOICE_HEADERS
VOICE_LIST)DRM)VoiceVoicesManagerFindVoicesManagerVoice)cafilec          	          V ^8  d   QhR\         P                  R\        P                  R\        \
        ,          R\        \        ,          /# )   sessionssl_ctxproxyreturn)aiohttpClientSessionssl
SSLContextr   strr   r
   )formats   "N/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/edge_tts/voices.py__annotate__r      s>     $ $""$-0^^$DLSM$	%[$    c                $  "   V P                  \         R\        P                  ! 4        R\         2\        P
                  ! \        4      VVRR7      ;_uu_4       GRj  xL
 p\        P                  ! VP                  4       G Rj  xL
 4      pRRR4      GRj  xL
  X FE  pRV9  d   / VR&   RVR,          9  d   . VR,          R&   RVR,          9  g   K9  . VR,          R&   KG  	  V#  L Lg LU  + GRj  xL 
 '       g   i     Ll; i5i)	a  
Private function that makes the request to the voice list URL and parses the
JSON response. This function is used by list_voices() and makes it easier to
handle client response errors related to clock skew.

Args:
    session (aiohttp.ClientSession): The aiohttp session to use for the request.
    ssl_ctx (ssl.SSLContext): The SSL context to use for the request.
    proxy (Optional[str]): The proxy to use for the request.

Returns:
    List[Voice]: A list of voices and their attributes.
z&Sec-MS-GEC=z&Sec-MS-GEC-Version=T)headersr   r   raise_for_statusNVoiceTagContentCategoriesVoicePersonalities)
getr   r	   generate_sec_ms_gecr   headers_with_muidr   jsonloadstext)r   r   r   urldatavoices   &&&   r   __list_voicesr,      s       {{,l3#:#:#<"=
12	4%%m4     
**388:%56  U" "E*eJ&7757E*12uZ'8868E*23  K) &6   sf   AD C.!D$$C4C0	C4DC2:DD0C42D4D	:C=;
D	D	D	connectorr   c                    V ^8  d   QhR\         \        P                  ,          R\         \        ,          R\        \
        ,          /# )r   r-   r   r   )r   r   BaseConnectorr   r   r
   )r   s   "r   r   r   :   s7      7001AI#	%[r   c                  "   \         P                  ! V RR7      ;_uu_4       GRj  xL
 p \        V\        V4      G Rj  xL
 pRRR4      GRj  xL
  V#  L0 L  \         P                   dM   pTP
                  R8w  d   h \        P                  ! T4       \        T\        T4      G Rj  xL 
 p Rp?LrRp?ii ; i Ln  + GRj  xL 
 '       g   i     X# ; i5i)am  
List all available voices and their attributes.

This pulls data from the URL used by Microsoft Edge to return a list of
all available voices.

Args:
    connector (Optional[aiohttp.BaseConnector]): The connector to use for the request.
    proxy (Optional[str]): The proxy to use for the request.

Returns:
    List[Voice]: A list of voices and their attributes.
T)r-   	trust_envNi  )r   r   r,   _SSL_CTXClientResponseErrorstatusr	   handle_client_response_error)r-   r   r   r*   es   $$   r   list_voicesr7   :   s       $$yDIIIW	A&w%@@D JI K J@** 	Axx3,,Q/&w%@@@D	A JIII Ks   %CACCAAACC CAB=1<B8-B0
.B83C8B==C CC	C	
C	C		Cc                   h   a  ] tR t^Vt o RtV 3R lR lt]R
V 3R lR ll4       tV 3R lR ltR	t	V t
R# )VoicesManagerz>
A class to find the correct voice based on their attributes.
c                   < V ^8  d   QhRR/# )r   r   N )r   __classdict__s   "r   r   VoicesManager.__annotate__[   s     ) )$ )r   c                "    . V n         R V n        R# )FN)voicescalled_create)selfs   &r   __init__VoicesManager.__init__[   s    02#(r   Nc                D   < V ^8  d   QhRS[ S[S[,          ,          RR/# )r   custom_voicesr   r9   )r   r   r
   )r   r<   s   "r   r   r=   `   s&      $T%[1	r   c                   "   \        4       pVf   \        4       G Rj  xL
 MTpV Uu. uF(  p/ VCRVR,          P                  R4      ^ ,          /CNK*  	  upVn        RVn        V#  LIu upi 5i)zL
Creates a VoicesManager object and populates it with all available voices.
NLanguageLocale-T)r9   r7   splitr?   r@   )clsrE   rA   r?   r+   s   &&   r   createVoicesManager.create_   sw      (5(={}$$=NT
NTU@u@j%/"7"7"<Q"?@f
 " %
s    A/A(
A/.A*A/*A/c                F   < V ^8  d   QhRS[ S[,          RS[S[,          /# )r   kwargsr   )r   r   r   r   )r   r<   s   "r   r   r=   n   s'      V$56 4@R;S r   c                    V P                   '       g   \        R4      hV P                   Uu. uF)  q!P                  4       VP                  4       8:  g   K'  VNK+  	  ppV# u upi )z=
Finds all matching voices based on the provided attributes.
z9VoicesManager.find() called before VoicesManager.create())r@   RuntimeErrorr?   items)rA   rO   r+   matching_voicess   &,  r   findVoicesManager.findn   sb     !!!K 
  ${{
*elln.MEE{ 	 
 
s   $AA)r@   r?   )N)__name__
__module____qualname____firstlineno____doc__rB   classmethodrL   rT   __static_attributes____classdictcell__)r<   s   @r   r9   r9   V   s7     ) )    r   r9   )rZ   r&   r   typingr   r   r   r   certifityping_extensionsr   	constantsr   r   r   drmr	   r
   r   r   create_default_contextwherer2   r,   r7   r9   r;   r   r   <module>re      sk   ,  
 & &   $ D D  @ @%%W]]_=$N48QU8$ $r   