xtd 0.2.0
Loading...
Searching...
No Matches
xtd::speech::synthesis::speech_synthesizer Class Reference
Inheritance diagram for xtd::speech::synthesis::speech_synthesizer:
xtd::object

Definition

Provides access to the functionality of an installed speech synthesis engine.

Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
Provides access to the functionality of an installed speech synthesis engine.
Definition speech_synthesizer.h:35
#define core_export_
Define shared library export.
Definition core_export.h:13
Inheritance
xtd::objectxtd::speech::synthesis::speech_synthesizer
Header
#include <xtd/speech/synthesis/speech_synthesizer>
Namespace
xtd::speech::synthesis
Library
xtd.core
Examples
hello_world_say.cpp.

Public Events

event< speech_synthesizer, speak_completed_event_handlerspeak_completed
 Raised when the xtd::speech::synthesis::speech_synthesizer completes the speaking of a prompt.
 
event< speech_synthesizer, speak_started_event_handlerspeak_started
 Raised when the xtd::speech::synthesis::speech_synthesizer begins the speaking of a prompt.
 
event< speech_synthesizer, state_changed_event_handlerstate_changed
 Raised when the state of the xtd::speech::synthesis::speech_synthesizer changes.
 

Public Constructors

 speech_synthesizer ()
 Initializes a new instance of the xtd::speech::synthesis::speech_synthesizer class.
 

Public Properties

synthesizer_state state () const noexcept
 Gets the current speaking state of the xtd::speech::speech_synthesizer object.
 

Public Methods

void speak (const xtd::string &text_to_speak)
 Synchronously speaks the contents of a string.
 
void speak (xtd::speech::synthesis::prompt &prompt)
 Synchronously speaks the contents of a xtd::speech::synthesis::prompt object.
 
xtd::speech::synthesis::promptspeak_async (const xtd::string &text_to_speak)
 Asynchronously speaks the contents of a string.
 
void speak_async (xtd::speech::synthesis::prompt &prompt)
 Asynchronously speaks the contents of a xtd::speech::synthesis::prompt object.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ speech_synthesizer()

xtd::speech::synthesis::speech_synthesizer::speech_synthesizer ( )

Initializes a new instance of the xtd::speech::synthesis::speech_synthesizer class.

Remarks
When you initialize a new xtd::speech::synthesis::speech_synthesizer instance, it uses the default system voice. To configure the xtd::speech::synthesis::speech_synthesizer to use one of the installed speech synthesis (text-to-speech) voices, use the xtd::speech::synthesis::speech_synthesizer::select_voice or xtd::speech::synthesis::speech_synthesizer::select_voice_by_hints method. To get information about which voices are installed, use the xtd::speech::synthesis::speech_synthesizer::get_installed_voices method and the xtd::speech::synthesis::voice_info class.

Member Function Documentation

◆ state()

synthesizer_state xtd::speech::synthesis::speech_synthesizer::state ( ) const
noexcept

Gets the current speaking state of the xtd::speech::speech_synthesizer object.

Returns
Returns the current speaking state of the xtd::speech::speech_synthesizer object.

◆ speak() [1/2]

void xtd::speech::synthesis::speech_synthesizer::speak ( const xtd::string text_to_speak)

Synchronously speaks the contents of a string.

Parameters
text_to_speakThe text to speak.
Remarks
To asynchronously speak the contents of a xtd::speech::synthesis::prompt_builder object, use xtd::speech::synthesis::speech_synthesizer::speak_async.

◆ speak() [2/2]

void xtd::speech::synthesis::speech_synthesizer::speak ( xtd::speech::synthesis::prompt prompt)

Synchronously speaks the contents of a xtd::speech::synthesis::prompt object.

Parameters
promptThe content to speak.
Remarks
To asynchronously speak the contents of a xtd::speech::synthesis::prompt_builder object, use xtd::speech::synthesis::speech_synthesizer::speak_async.

◆ speak_async() [1/2]

xtd::speech::synthesis::prompt & xtd::speech::synthesis::speech_synthesizer::speak_async ( const xtd::string text_to_speak)

Asynchronously speaks the contents of a string.

Parameters
text_to_speakThe text to speak.
Returns
Returns the object that contains the content to speak.

◆ speak_async() [2/2]

void xtd::speech::synthesis::speech_synthesizer::speak_async ( xtd::speech::synthesis::prompt prompt)

Asynchronously speaks the contents of a xtd::speech::synthesis::prompt object.

Parameters
promptThe content to speak.

Member Data Documentation

◆ speak_completed

event<speech_synthesizer, speak_completed_event_handler> xtd::speech::synthesis::speech_synthesizer::speak_completed

Raised when the xtd::speech::synthesis::speech_synthesizer completes the speaking of a prompt.

Remarks
The xtd::speech::synthesis::speech_synthesizer raises the xtd::speech::synthesis::speech_synthesizer::speak_completed event at the completion of any of the xtd::speech::synthesis::speech_synthesizer::speak, xtd::speech::synthesis::speech_synthesizer::speak_async, xtd::speech::synthesis::speech_synthesizer::speak_ssml, or xtd::speech::synthesis::speech_synthesizer::speak_ssml_async methods.

◆ speak_started

event<speech_synthesizer, speak_started_event_handler> xtd::speech::synthesis::speech_synthesizer::speak_started

Raised when the xtd::speech::synthesis::speech_synthesizer begins the speaking of a prompt.

Remarks
The xtd::speech::synthesis::speech_synthesizer raises this event when it begins processing a prompt using any of the xtd::speech::synthesis::speech_synthesizer::speak, xtd::speech::synthesis::speech_synthesizer::speak_async, xtd::speech::synthesis::speech_synthesizer::speak_ssml, or xtd::speech::synthesis::speech_synthesizer::speak_ssml_async methods.

◆ state_changed

event<speech_synthesizer, state_changed_event_handler> xtd::speech::synthesis::speech_synthesizer::state_changed

Raised when the state of the xtd::speech::synthesis::speech_synthesizer changes.

Remarks
The xtd::speech::synthesis::speech_synthesizer raises this event when its speaking xtd::speech::synthesis::speech_synthesizer::state changes. For an example and more information about data associated with the event, see xtd::speech::synthesis::state_changed_event_args.
To pause and resume speech synthesis, use the xtd::speech::synthesis::speech_synthesizer::pause and xtd::speech::synthesis::speech_synthesizer::resume methods.

The documentation for this class was generated from the following file: