
    #HJj                     @    d dl mZ d dlZd dlZd dlZd Zd Zd Zd Zy)    )PathNc                      t        j                         dk(  rdnt        j                         dk(  rdnd} t        j                         dk(  rd| z   nd| z   }t        t        t              j
                  |z        S )NWindowsz.dllLinuxz.soz.dylibz	espeak-ngzlibespeak-ng)platformsystemstrr   __file__parent)extlib_names     b/Users/ahmed/devFolder/claude-voice/.venv/lib/python3.12/site-packages/espeakng_loader/__init__.pyget_library_pathr      sc    OO%2&ARV]A]ckC$,OO$5$B{S Y\H\HtH~$$x/00    c                      t        t              j                  dz  } | j                         st	        d|        t        |       S )Nzespeak-ng-datazdata path not exists at )r   r
   r   existsRuntimeErrorr	   )	data_paths    r   get_data_pathr      s@    X%%(88I5i[ABBy>r   c                      	 t               } t        j                  |       }|S # t        $ r}t	        d  d|        Y d}~yd}~ww xY w)z"
    Load the shared library.
    z"Error loading shared library from z: N)r   ctypesCDLLOSErrorprint)lib_pathlibes      r   load_libraryr      sK    #%kk(#
 28*BqcBCs    # 	AAAc                  (   t               } t        t        |       j                        }t	        j
                         dk(  rt        j                  |       y	t	        j
                         dk(  r8|dz   t        j                  j                  dd      z   t        j                  d<   y	t	        j
                         dk(  r8|dz   t        j                  j                  dd      z   t        j                  d<   y	t        dt	        j
                                )
zW
    Add the directory containing the shared library to the system's library path.
    r   r   :LD_LIBRARY_PATH DarwinDYLD_LIBRARY_PATHzUnsupported platform: N)r   r	   r   r   r   r   osadd_dll_directoryenvironget	Exception)r   lib_dirs     r   make_library_availabler+      s     
C$s)""#GI%
W%		g	%(/#

GXZ\8](]

$%		h	&*1C-"**..I\^`:a*a

&'01B0CDEEr   )	pathlibr   r   r   r%   r   r   r   r+    r   r   <module>r.      s&       	1

Fr   