Can perform voice synthesis. More...
Public Member Functions | |
Channel (Channel const &) noexcept=delete | |
Channel (Channel &&) noexcept=default | |
Channel & | operator= (Channel const &) noexcept=delete |
Channel & | operator= (Channel &&) noexcept=default |
virtual | ~Channel () noexcept=default |
auto | name () const -> std::string const & |
Name of this particular Channel instance. More... | |
auto | currentVoice () const -> std::string const & |
Name of the currently activated voice, if any. More... | |
bool | nativeEventsEnabled () const |
Tells whether native events can be received in the events callback (false by default) More... | |
virtual int | sampleRate () const =0 |
The sample rate used during synthesis operations in Hertz. More... | |
virtual int | channelCount () const =0 |
The channel count used during synthesis operations. More... | |
void | setCurrentVoice (std::string const &voice) |
Activates a voice for the all future synthesis operations. More... | |
void | setNativeEventsEnabled (bool enabled) |
Sets whether to receive native events in the events callback. More... | |
bool | synthesizeFromText (std::string text) |
Prepares the next synthesis from a text string (either raw or containing SSML) More... | |
bool | synthesizeFromFile (std::string const &path) |
Prepares the next synthesis from a file (containing either raw text or SSML). More... | |
Public Member Functions inherited from Vsdk::Audio::ProducerModule | |
ProducerModule () | |
ProducerModule (ProducerModule &&) | |
ProducerModule & | operator= (ProducerModule &&) |
virtual | ~ProducerModule ()=0 |
ProducerModule (ProducerModule const &)=delete | |
ProducerModule & | operator= (ProducerModule const &)=delete |
auto | subscribeFirst (AudioCallback c) -> Iterator |
Subscribes as first in the list of audio buffer receivers for this producer. More... | |
auto | subscribeLast (AudioCallback c) -> Iterator |
Subscribes as last in the list of audio buffer receivers for this producer. More... | |
void | unsubscribe (Iterator it) noexcept |
Unsubscribes from this producer audio buffer dispatch list. More... | |
auto | lastError () const -> std::string |
auto | state () const -> State |
bool | isOpened () const |
bool | isRunning () const |
bool | isStarted () const |
bool | isPaused () const |
bool | isIdle () const |
bool | isClosed () const |
bool | open () noexcept |
Attempts to open the underlying resource(s) of the producer. More... | |
bool | run () noexcept |
bool | start () noexcept |
bool | pause () noexcept |
Attempts to pause a started producer. More... | |
bool | resume () noexcept |
Attempts to resume a paused producer. More... | |
bool | stop () noexcept |
Attempts to stop a started producer. More... | |
bool | close () noexcept |
Protected Member Functions | |
Channel (std::shared_ptr< Engine > engine, std::string name) noexcept | |
virtual void | setCurrentVoiceImpl (std::string const &voice)=0 |
virtual void | synthesize (std::string const &text, bool async)=0 |
void | runImpl () override |
void | startImpl () override |
void | dispatchEvent (Event event) |
void | dispatchError (Error error) |
Protected Member Functions inherited from Vsdk::Audio::ProducerModule | |
virtual void | openImpl () |
virtual void | pauseImpl () |
virtual void | resumeImpl () |
virtual void | stopImpl () |
virtual void | closeImpl () |
void | dispatchBuffer (Buffer buffer, bool last) |
template<typename T > | |
void | dispatchAudio (T &&data, int sampleRate, int channelCount, bool isLast) |
Additional Inherited Members | |
Public Types inherited from Vsdk::Audio::ProducerModule | |
enum | State { State::Closed, State::Opened, State::Running, State::Started, State::Paused, State::Idle } |
using | Iterator = details::Iterator< decltype(_subscribers)> |
Iterator pointing to a subscriber of this producer. More... | |
Protected Attributes inherited from Vsdk::Audio::ProducerModule | |
std::atomic< State > | _state |
Can perform voice synthesis.
|
protectednoexcept |
|
deletenoexcept |
|
defaultnoexcept |
|
virtualdefaultnoexcept |
auto Channel::name | ( | ) | const -> std::string const & |
Name of this particular Channel instance.
auto Channel::currentVoice | ( | ) | const -> std::string const & |
Name of the currently activated voice, if any.
bool Channel::nativeEventsEnabled | ( | ) | const |
Tells whether native events can be received in the events callback (false
by default)
|
pure virtual |
The sample rate used during synthesis operations in Hertz.
|
pure virtual |
The channel count used during synthesis operations.
void Channel::setCurrentVoice | ( | std::string const & | voice | ) |
Activates a voice for the all future synthesis operations.
Vsdk::Exception | if the engine failed to activate the requested voice |
void Channel::setNativeEventsEnabled | ( | bool | enabled | ) |
Sets whether to receive native events in the events callback.
bool Channel::synthesizeFromText | ( | std::string | text | ) |
Prepares the next synthesis from a text string (either raw or containing SSML)
start()
or run()
will start the synthesis Vsdk::Exception | if text is empty or if an attempt to synthesize failed |
true
if a synthesis started right away, else false
bool Channel::synthesizeFromFile | ( | std::string const & | path | ) |
Prepares the next synthesis from a file (containing either raw text or SSML).
The file is read right away and its content is stored as preparation for the next synthesis.
start()
or run()
will start the synthesis Vsdk::Exception | if file is not a valid file path, if contained text is empty or if an attempt to synthesize failed |
true
if a synthesis started right away, else false
|
protectedpure virtual |
|
protectedpure virtual |
|
overrideprotectedvirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
|
overrideprotectedvirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
|
protected |
|
protected |