+
    Qi  c                  s    R t ^ RIHt RtRtRtRtRt^ RIH	t	H
t
HtHt ]'       d*   ^ RIt]P                  ! R	R
4       ^ RIHt ^RIHt ^RIHt  ! R R]4      t ! R R4      t ! R R4      tR# )z.Functionality for working with speech servers.)annotationsz$Id$z
$Revision$z$Date$z-Copyright (c) 2005-2008 Sun Microsystems Inc.ZLGPL)AnyCallableIteratorTYPE_CHECKINGNAtspiz2.0)r   )input_event)ACSSc            
      sZ    ] tR t^+tRtRtRtRtRtRt	Rt
Rt]R	]R	]R	]R	]	R	/tR
 R ltRtR	# )VoiceFamilyz)Holds the family description for a voice.ZnameZgenderZlangdialectZvariantZmaleZfemaleNc                    V ^8  d   QhRRRR/# )   propszdict[str, Any] | NonereturnNone Zformat   "6/usr/lib/python3.14/site-packages/orca/speechserver.py__annotate__ZVoiceFamily.__annotate__?   s      3      c                s    \         P                  V 4       V P                  \        P                  4       V'       d   V P                  V4       R# R# )z"Create and initialize VoiceFamily.N)dict__init__Zupdater   settings)selfr      &&r   r   ZVoiceFamily.__init__?   s4    dK(()KK r   r   )__name__
__module____qualname____firstlineno____doc__ZNAMEZGENDERZLANGZDIALECTZVARIANTZMALEZFEMALEr   r   __static_attributes__r   r   r   r   r   +   sT    3DFDGGDF 	H r   r   c                  sZ    ] tR t^GtRt^ t^t^tRR R lltR R lt	R R lt
R R	 ltR
tR# )SayAllContextzDContains information about the current state of a Say All operation.c          
     s,    V ^8  d   QhRRRRRRRRRR	/# )
r   objzAtspi.Accessible	utterancestrstart_offsetint
end_offsetr   r   r   r   r   r   r   SayAllContext.__annotate__N   s<     ' '' ' 	'
 ' 
'r   c                	sP    Wn         W n        W0n        W@n        W0n        R V n        R # N)r!   r"   r$   r&   current_offsetcurrent_end_offset)r   r!   r"   r$   r&   s   &&&&&r   r   ZSayAllContext.__init__N   s'     "($*"&r   c                   V ^8  d   QhRR/# r   r   r#   r   r   r   r   r   r'   \   s     
 
 
r   c                	s    R V P                    RV P                   RV P                   RV P                   RV P                   R2# )z	SAY ALL: z 'z' (Z-z, current: Z))r!   r"   r$   r&   r)   r      &r   __str__ZSayAllContext.__str__\   sN    zDNN#33t7H7H6I4??J[ \++,A/	
r   c               r+   )r   r   r    r   r   r   r   r   r'   b   s      m r   c                s    \        V P                  V P                  V P                  V P                  4      pV P
                  Vn        V P                  Vn        V# )z%Returns a copy of this SayAllContext.)r    r!   r"   r$   r&   r)   r*   )r   Znews   & r   copyZSayAllContext.copyb   sG     DHHdnnd6G6GY!00!%!8!8
r   c               r
   )r   otherZobjectr   boolr   r   r   r   r   r'   j   s     3 3F 3t 3r   c                	s*   \        V\        4      '       g   R # V P                  VP                  8H  ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P
                  VP
                  8H  # )F)Z
isinstancer    r$   r&   r!   r"   )r   r1   r   r   __eq__ZSayAllContext.__eq__j   s}    %//!!U%7%77 2 25#3#332 2EII%2 2 %//1	3r   )r*   r)   r&   r!   r$   r"   N)r4   )r   r   r   r   r   ZPROGRESSZINTERRUPTEDZ	COMPLETEDr   r/   r0   r3   r   r   r   r   r    r    G   s-    NHKI'
3 3r   r    c                  s   ] tR t^stRt]R R l4       t]R R l4       t]R R l4       t]R R	 l4       t	R
 R lt
R R ltR R ltR R ltR<R R lltR<R R lltR=R R lltR R ltR>R R lltR>R R lltR?R R  lltR?R! R" lltR?R# R$ lltR?R% R& lltR' R( ltR) R* ltR+ R, ltR- R. ltR/ R0 ltR1 R2 ltR3 R4 ltR5 R6 ltR<R7 R8 llt R@R9 R: llt!R;t"R# )ASpeechServerz#Provides speech server abstraction.c               r+   r,   r   r   r   r   r   SpeechServer.__annotate__w   s      c r   c                     R# )z1Returns a localized name describing this factory. r   r   r   r   get_factory_nameZSpeechServer.get_factory_namev   s     r   c               r+   )r   r   z	list[Any]r   r   r   r   r   r6   }   s      	 r   c                     . # )z+Returns a list of available speech servers.r   r   r   r   get_speech_serversZSpeechServer.get_speech_servers|   s	     	r   c               r
   )r   _infor   r   zSpeechServer | Noner   r   r   r   r   r6      s       )< r   c                r7   )z9Gets a given SpeechServer based upon the [name, id] info.Nr   )r<   r.   r   get_speech_serverZSpeechServer.get_speech_server   s     r   c               r+   r   r   r   r   r   r   r   r   r6      s     5 5T 5r   c                 r7   )z&Cleans up and shuts down this factory.Nr   r   r   r   shutdown_active_serversZ$SpeechServer.shutdown_active_servers       r   c               r+   )r   r   z	list[str]r   r   r   r   r   r6      s      ) r   c                s
    RR.# )z0Returns [name, id] of the current speech server.r8   r   r-   r.   r   get_infoZSpeechServer.get_info   s     Bxr   c               r+   )r   r   zlist[VoiceFamily]r   r   r   r   r   r6      s      $5 r   c                r:   )zIReturns a list of all known VoiceFamily instances provided by the server.r   r-   r.   r   get_voice_familiesZSpeechServer.get_voice_families   	     	r   c               r+   )r   r   r   r   r   r   r   r   r6      s      + r   c                s    \        / 4      # )z=Returns the current voice family as a VoiceFamily dictionary.)r   r-   r.   r   get_voice_familyZSpeechServer.get_voice_family   s     2r   c               r
   )r   familyr   r   r   r   r   r   r   r   r6      s     F F{ Ft Fr   c                r7   )z7Sets the voice family to family VoiceFamily dictionary.Nr   )r   rE   r   r   set_voice_familyZSpeechServer.set_voice_family   r@   r   Nc               $    V ^8  d   QhRRRRRR/# )r   	characterr#   acssACSS | Noner   r   r   r   r   r   r   r6      s!          K  4  r   c                r7   )zSpeaks character.Nr   )r   rH   rI      &&&r   speak_characterZSpeechServer.speak_character   r@   r   c               rG   )r   eventzinput_event.KeyboardEventrI   rJ   r   r   r   r   r   r   r   r6      s#      %> k ]a r   c                r7   )zSpeaks event.Nr   )r   rM   rI   rK   r   speak_key_eventZSpeechServer.speak_key_event   r@   r   c               s(    V ^8  d   QhRRRRRRRR/# )	r   textz
str | NonerI   rJ   	interruptr2   r   r   r   r   r   r   r   r6      s2     = == = 	=
 
=r   c                r7   )z.Speaks text using the voice specified by acss.Nr   )r   rO   rI   rP      &&&&r   speakZSpeechServer.speak   r@   r   c               rG   )r   utterance_iteratorz$Iterator[tuple[SayAllContext, ACSS]]progress_callbackz$Callable[[SayAllContext, int], None]r   r   r   r   r   r   r   r6      s.     V V@V @V 
	Vr   c                r7   )zGIterates through the given utterance_iterator, speaking each utterance.Nr   )r   rS   rT   rK   r   say_allZSpeechServer.say_all   r@   r   c               r
   r   stepr%   r   r   r   r   r   r   r   r6           ) ) )T )r   c                r7   )zIncreases the speech rate.Nr   r   rW   r   r   increase_speech_rateZ!SpeechServer.increase_speech_rate   r@   r   c               r
   rV   r   r   r   r   r   r6      rX   r   c                r7   )zDecreases the speech rate.Nr   rY   r   r   decrease_speech_rateZ!SpeechServer.decrease_speech_rate   r@   r   c               r
   r   rW   Zfloatr   r   r   r   r   r   r   r6           * *% *$ *r   c                r7   )zIncreases the speech pitch.Nr   rY   r   r   increase_speech_pitchZ"SpeechServer.increase_speech_pitch   r@   r   c               r
   r\   r   r   r   r   r   r6      r]   r   c                r7   )zDecreases the speech pitch.Nr   rY   r   r   decrease_speech_pitchZ"SpeechServer.decrease_speech_pitch   r@   r   c               r
   r\   r   r   r   r   r   r6           + +5 +4 +r   c                r7   )zIncreases the speech volume.Nr   rY   r   r   increase_speech_volumeZ#SpeechServer.increase_speech_volume   r@   r   c               r
   r\   r   r   r   r   r   r6      r`   r   c                r7   )zDecreases the speech volume.Nr   rY   r   r   decrease_speech_volumeZ#SpeechServer.decrease_speech_volume   r@   r   c               r+   r>   r   r   r   r   r   r6      s     J JT Jr   c                r7   )z;Updates the capitalization style used by the speech server.Nr   r-   r.   r   update_capitalization_styleZ(SpeechServer.update_capitalization_style   r@   r   c               r+   r>   r   r   r   r   r   r6      s     C C$ Cr   c                r7   )z4Punctuation level changed, inform this speechServer.Nr   r-   r.   r   update_punctuation_levelZ%SpeechServer.update_punctuation_level   r@   r   c               r+   r>   r   r   r   r   r   r6      s     : :d :r   c                r7   )z+Stops ongoing speech and flushes the queue.Nr   r-   r.   r   stopZSpeechServer.stop   r@   r   c               r+   r>   r   r   r   r   r   r6      s     , ,$ ,r   c                r7   )zShuts down the speech engine.Nr   r-   r.   r   shutdownZSpeechServer.shutdown   r@   r   c               r+   r>   r   r   r   r   r   r6      s     ( (t (r   c                r7   )zResets the speech engine.Nr   r-   r.   r   resetZSpeechServer.reset   r@   r   c               r+   r,   r   r   r   r   r   r6      s      3 r   c                r7   )z=Returns the output module associated with this speech server.r8   r   r-   r.   r   get_output_moduleZSpeechServer.get_output_module   s     r   c               r
   )r   	module_idr#   r   r   r   r   r   r   r   r6      s     I I3 I4 Ir   c                r7   )z:Sets the output module associated with this speech server.Nr   )r   ri   r   r   set_output_moduleZSpeechServer.set_output_module   r@   r   c               r+   )r   r   ztuple[str, ...]r   r   r   r   r   r6      s      _ r   c                r7   )z?Return names of available output modules as a tuple of strings.r   r   r-   r.   r   list_output_modulesZ SpeechServer.list_output_modules   rC   r   c               s(    V ^8  d   QhRRRRRRRR/# )r   languager#   r	   maximumz
int | Noner   z!list[tuple[str, str, str | None]]r   r   r   r   r   r6      s2        	
 
+r   c                r:   )zGReturns the families for language available in the current synthesizer.r   )r   rl   r	   rm   rQ   r   get_voice_families_for_languageZ,SpeechServer.get_voice_families_for_language   s	     	r   c               s$    V ^8  d   QhRRRRRR/# )r   rl   r#   r	   r   r2   r   r   r   r   r   r6      s"       s TX r   c                r7   )zFReturns True if we should change the voice for the specified language.Fr   )r   rl   r	   rK   r    should_change_voice_for_languageZ-SpeechServer.should_change_voice_for_language   s     r   r   r(   )NNT)i   )g      ?)r8   )#r   r   r   r   r   Zstaticmethodr9   r;   r=   r?   rA   rB   rD   rF   rL   rN   rR   rU   rZ   r[   r^   r_   ra   rb   rc   rd   re   rf   rg   rh   rj   rk   rn   ro   r   r   r   r   r5   r5   s   s    - 
  
  
 5 5


F =V))**++JC:,(
I
 r   r5   )r   Z
__future__r    Z__id__Z__version__Z__date__Z__copyright__Z__license__Ztypingr   r   r   r   ZgiZrequire_versionZgi.repositoryr   r8   r   rI   r   r   r   r    r5   r   r   r   <module>rp      sp   . 5 #? 9 9w&#$ 8)3 )3X{ {r   