
    yhx                     4    S SK Jr  SSKrS r " S S\5      rg)   )Voice    Nc                     [        U 5      $ )z
Builds a new instance of a driver and returns it for use by the driver
proxy.

@param proxy: Proxy creating the driver
@type proxy: L{driver.DriverProxy}
)DummyDriver)proxys    M/var/www/auris/envauris/lib/python3.13/site-packages/pyttsx3/drivers/dummy.pybuildDriverr	      s     u    c                   N    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rSrg)r      a~  
Dummy speech engine implementation. Documents the interface, notifications,
properties, and sequencing responsibilities of a driver implementation.

@ivar _proxy: Driver proxy that manages this instance
@type _proxy: L{driver.DriverProxy}
@ivar _config: Dummy configuration
@type _config: dict
@ivar _looping: True when in the dummy event loop, False when not
@ivar _looping: bool
c           	          Xl         SU l        [        SSSS/SS5      [        SS	SS/S
S5      [        SSSS/SS5      /nSSUS   US.U l        g)zd
Constructs the driver.

@param proxy: Proxy creating the driver
@type proxy: L{driver.DriverProxy}
Fzdummy.voice1zJohn Doezen-USzen-GBmaleadultzdummy.voice2zJane Doefemalezdummy.voice3z	Jimmy Doe
      g      ?r   )ratevolumevoicevoicesN)_proxy_loopingr   _config)selfr   r   s      r   __init__DummyDriver.__init__   ss      .*w.@&'R.*w.@(GT.+/A62N
 Qi	
r
   c                     g)z
Optional method that will be called when the driver proxy is being
destroyed. Can cleanup any resources to make sure the engine terminates
properly.
N r   s    r   destroyDummyDriver.destroy2   s     	r
   c                     SnSU l         U R                   (       aN  U(       a  U R                  R                  S5        Sn[        R                  " S5        U R                   (       a  MM  gg)z
Starts a blocking run loop in which driver callbacks are properly
invoked.

@precondition: There was no previous successful call to L{startLoop}
    without an intervening call to L{stopLoop}.
TFg      ?N)r   r   setBusytimesleep)r   firsts     r   	startLoopDummyDriver.startLoop:   sG     mm##E*JJsO	 mmmr
   c                     SU l         g)z
Stops a previously started run loop.

@precondition: A previous call to L{startLoop} suceeded and there was
    no intervening call to L{endLoop}.
FN)r   r   s    r   endLoopDummyDriver.endLoopJ   s     r
   c              #   J   #    U R                   R                  S5        Sv   g7f)z,
Iterates from within an external run loop.
FN)r   r#   r   s    r   iterateDummyDriver.iterateS   s      	E"s   !#c                    U R                   R                  S5        U R                   R                  S5        SnUR                  S5       H@  nU R                   R                  SU[	        U5      S9   UR                  SUS-   5      S-   nMB     U R                   R                  SSS	9  U R                   R                  S
5        g! [         a     M  f = f)a  
Speaks the given text. Generates the following notifications during
output:

started-utterance: When speech output has started
started-word: When a word is about to be spoken. Includes the character
    "location" of the start of the word in the original utterance text
    and the "length" of the word in characters.
finished-utterance: When speech output has finished. Includes a flag
    indicating if the entire utterance was "completed" or not.

The proxy automatically adds any "name" associated with the utterance
to the notifications on behalf of the driver.

When starting to output an utterance, the driver must inform its proxy
that it is busy by invoking L{driver.DriverProxy.setBusy} with a flag
of True. When the utterance completes or is interrupted, the driver
inform the proxy that it is no longer busy by invoking
L{driver.DriverProxy.setBusy} with a flag of False.

@param text: Unicode text to speak
@type text: unicode
Tzstarted-utterancer    zstarted-word)locationlength   zfinished-utterance)	completedFN)r   r#   notifysplitlenindex	Exception)r   textiwords       r   sayDummyDriver.sayZ   s    0 	D!./JJsODKK~#d)LJJsAaC(* $ 	/4@E"  s   2C
CCc                     g)z
Stops any current output. If an utterance was being spoken, the driver
is still responsible for sending the closing finished-utterance
notification documented above and resetting the busy state of the
proxy.
Nr   r   s    r   stopDummyDriver.stop~   s     	r
   c                 Z     U R                   U   $ ! [         a    [        SU-  5      ef = f)a  
Gets a property value of the speech engine. The suppoted properties
and their values are:

voices: List of L{voice.Voice} objects supported by the driver
voice: String ID of the current voice
rate: Integer speech rate in words per minute
volume: Floating point volume of speech in the range [0.0, 1.0]

@param name: Property name
@type name: str
@raise KeyError: When the property name is unknown
unknown property %s)r   KeyError)r   names     r   getPropertyDummyDriver.getProperty   s6    	9<<%% 	904788	9s    *c                    ^ US:X  a0  [        U4S jU R                  S   5      nUS   U R                  S'   gUS:X  a  TU R                  S'   gUS:X  a  TU R                  S'   g[        SU-  5      e)	a  
Sets one of the supported property values of the speech engine listed
above. If a value is invalid, attempts to clip it / coerce so it is
valid before giving up and firing an exception.

@param name: Property name
@type name: str
@param value: Property value
@type value: object
@raise KeyError: When the property name is unknown
@raise ValueError: When the value cannot be coerced to fit the property
r   c                 "   > U R                   T:H  $ )N)id)vvalues    r   <lambda>)DummyDriver.setProperty.<locals>.<lambda>   s    r
   r   r   r   r   rC   N)filterr   rD   )r   rE   rL   rK   s     ` r   setPropertyDummyDriver.setProperty   sp     7?.X0FGA$%aDDLL!V^#(DLL X%*DLL"04788r
   )r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r    r'   r*   r-   r=   r@   rF   rP   __static_attributes__r   r
   r   r   r      s5    

. "#H9&9r
   r   )r   r   r$   r	   objectr   r   r
   r   <module>rY      s     `9& `9r
   