TextToSpeech#
This component is also available in the classic reference.
The TextToSpeech widget wraps the HTML5 SpeechSynthesis API
Use pn.ui.TextToSpeech to create this component.
API#
.. py:class:: TextToSpeech(*, _voices, auto_speak, cancel, pause, resume, speak, lang, pitch, rate, voice, volume, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, label, value, name) :module: panel.widgets.text_to_speech
The TextToSpeech widget wraps the HTML5 SpeechSynthesis API
See https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis
Reference: https://panel.holoviz.org/reference/widgets/TextToSpeech.html
:Example:
TextToSpeech(label=”Speech Synthesis”, value=”Data apps are nice”)
.. !! processed by numpydoc !!
Parameter Definitions
Parameters inherited from:
:class:`panel.widgets.base.WidgetBase`: label
:class:`panel.viewable.Layoutable`: align, aspect_ratio, css_classes, design, min_width, min_height, max_width, max_height, styles, stylesheets, tags, width_policy, height_policy, sizing_mode, visible
:class:`panel.viewable.Viewable`: loading
:class:`panel.widgets.base.Widget`: height, margin, width, disabled
:class:`panel.widgets.text_to_speech.Utterance`: value, lang, pitch, rate, voice, volume
auto_speak = Boolean(default=True, label='Auto speak')
Whether or not to automatically speak when the value changes.
cancel = Event(default=False, label='Cancel')
Removes all utterances from the utterance queue.
pause = Event(default=False, label='Pause')
Puts the TextToSpeak object into a paused state.
resume = Event(default=False, label='Resume')
Puts the TextToSpeak object into a non-paused state: resumes
it if it was already paused.
paused = Boolean(constant=True, default=False, label='Paused', readonly=True)
A Boolean that returns true if the TextToSpeak object is in a
paused state.
pending = Boolean(constant=True, default=False, label='Pending', readonly=True)
A Boolean that returns true if the utterance queue contains
as-yet-unspoken utterances.
speak = Event(default=False, label='Speak')
Speak. I.e. send a new Utterance to the browser
speaking = Boolean(constant=True, default=False, label='Speaking', readonly=True)
A Boolean that returns true if an utterance is currently in
the process of being spoken — even if TextToSpeak is in a
paused state.
voices = List(bounds=(0, None), constant=True, default=[], item_type=<class 'panel.widgets.text_to_speech.Voice'>, label='Voices', readonly=True)
Returns a list of Voice objects representing all the available
voices on the current device.
_voices = List(bounds=(0, None), default=[], item_type=<class 'panel.widgets.text_to_speech.Voice'>, label=' voices')