
    11i                     $    S r SSKr " S S5      rg)z.Voice struct from Espeak API exposed to Python    Nc                       \ rS rSrSrSS\S\S\4S jjr\S 5       r\S 5       r	\S	 5       r
SS
 jrS r " S S\R                  5      rS r\S\4S j5       rSrg)EspeakVoice   z=A helper class to expose voice structures within C and Pythonnamelanguage
identifierc                 (    Xl         X l        X0l        g N)_name	_language_identifier)selfr   r   r   s       Y/home/james-whalen/.local/lib/python3.13/site-packages/phonemizer/backend/espeak/voice.py__init__EspeakVoice.__init__   s    
!%    c                     U R                   $ )z
Voice name)r   r   s    r   r   EspeakVoice.name   s     zzr   c                     U R                   $ )zLanguage code)r   r   s    r   r   EspeakVoice.language#   s     ~~r   c                     U R                   $ )z+Path to the voice file wrt espeak data path)r   r   s    r   r   EspeakVoice.identifier(   s     r   c                     U R                   UR                   :H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ r
   r   r   r   )r   others     r   __eq__EspeakVoice.__eq__-   sC    		UZZ' 4/45#3#33	5r   c                 Z    [        U R                  U R                  U R                  45      $ r
   )hashr   r   r   r   s    r   __hash__EspeakVoice.__hash__3   s     TYYt?@@r   c                   j    \ rS rSrSrS\R                  4S\R                  4S\R                  4/rSrg)EspeakVoice.VoiceStruct6   zA helper class to fetch voices information from the espeak library.

The espeak_VOICE struct is defined in speak_lib.h from the espeak code.
Here we use only name (voice name), languages (language code) and
identifier (voice file) information.

r   	languagesr    N)	__name__
__module____qualname____firstlineno____doc__ctypesc_char_p_fields___static_attributes__r'   r   r   VoiceStructr$   6   s4    	 V__%&//*6??+-r   r1   c                 8   U R                  U R                  (       a  U R                  R                  S5      OSU R                  (       a  U R                  R                  S5      OSU R                  (       a  U R                  R                  S5      5      $ S5      $ )z:Converts the Voice instance to  an espeak ctypes structureutf8N)r1   r   encoder   r   r   s    r   	to_ctypesEspeakVoice.to_ctypesC   sv    (,		DIIV$t,0MMDMM  (t.2ooDOO""6*I 	I DHI 	Ir   structc                     U " UR                   =(       d    SR                  5       UR                  =(       d    SR                  5       SS UR                  =(       d    SR                  5       S9$ )z>Returns a Voice instance built from an espeak ctypes structurer      0   Nr   )r   decoder&   r   )clsr7   s     r   from_ctypesEspeakVoice.from_ctypesJ   s[     ++$,,.&&.$668<))0S88:	< 	<r   )r   r   r   N) r?   r?   )r   r   )r(   r)   r*   r+   r,   strr   propertyr   r   r   r   r!   r-   	Structurer1   r5   classmethodr=   r0   r'   r   r   r   r      s    G&S & &s &
        5A-f&& -I < < <r   r   )r,   r-   r   r'   r   r   <module>rD      s    5 
;< ;<r   