xtd 0.2.0
speech_synthesizer.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "prompt.hpp"
10#include "../../event.hpp"
11#include "../../object.hpp"
12#include "../../string.hpp"
13
15namespace xtd {
17 namespace speech {
19 namespace synthesis {
36 struct data;
37
38
39 public:
41
47
51
53
57 synthesizer_state state() const noexcept;
59
61
66 void speak(const xtd::string& text_to_speak);
71
75 xtd::speech::synthesis::prompt& speak_async(const xtd::string& text_to_speak);
80
82
87
91
97
98 private:
99 void on_speak_completed();
100 void on_speak_started();
101 void set_state(synthesizer_state value);
102
103 xtd::sptr<data> data_;
104 };
105 }
106 }
107}
Represents an event.
Definition event.hpp:21
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Represents information about what can be rendered, either text or an audio file, by the xtd::speech::...
Definition prompt.hpp:36
speech_synthesizer()
Initializes a new instance of the xtd::speech::synthesis::speech_synthesizer class.
event< speech_synthesizer, speak_started_event_handler > speak_started
Raised when the xtd::speech::synthesis::speech_synthesizer begins the speaking of a prompt.
Definition speech_synthesizer.hpp:90
xtd::speech::synthesis::prompt & speak_async(const xtd::string &text_to_speak)
Asynchronously speaks the contents of a string.
event< speech_synthesizer, speak_completed_event_handler > speak_completed
Raised when the xtd::speech::synthesis::speech_synthesizer completes the speaking of a prompt.
Definition speech_synthesizer.hpp:86
synthesizer_state state() const noexcept
Gets the current speaking state of the xtd::speech::speech_synthesizer object.
event< speech_synthesizer, state_changed_event_handler > state_changed
Raised when the state of the xtd::speech::synthesis::speech_synthesizer changes.
Definition speech_synthesizer.hpp:95
void speak(const xtd::string &text_to_speak)
Synchronously speaks the contents of a string.
Contains xtd::event event.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::delegate< void(object &sender, const speak_completed_event_args &e)> speak_completed_event_handler
Represents the method that will handle xtd::speech::synthesis::speech_synthesizer::speak_completed ev...
Definition speak_completed_event_handler.hpp:29
xtd::delegate< void(object &sender, const state_changed_event_args &e)> state_changed_event_handler
Represents the method that will handle xtd::speech::synthesis::speech_synthesizer::speak_started even...
Definition state_changed_event_handler.hpp:29
xtd::delegate< void(object &sender, const speak_started_event_args &e)> speak_started_event_handler
Represents the method that will handle xtd::speech::synthesis::speech_synthesizer::speak_started even...
Definition speak_started_event_handler.hpp:29
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
synthesizer_state
Enumerates values for the state of the xtd::speech::synthesis::speech_synthesizer.
Definition synthesizer_state.hpp:28
Contains classes for initializing and configuring a speech synthesis engine, for creating prompts,...
Definition prompt.hpp:13
The xtd::speech namespace contains all classes and namespace to access speech technology.
Definition prompt.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::object class.
Contains xtd::speech::synthesis::prompt class.
Contains xtd::speech::synthesis::speak_completed_event_handler handler.
Contains xtd::speech::synthesis::speak_started_event_handler handler.
Contains xtd::speech::synthesis::state_changed_event_handler handler.
Contains xtd::string alias.
Contains xtd::speech::synthesis::synthesizer_state enum class.