6#ifndef YARP_GOOGLESPEECHSYNTH_H
7#define YARP_GOOGLESPEECHSYNTH_H
15#include "google/cloud/texttospeech/v1/text_to_speech_client.h"
16#include "google/protobuf/repeated_ptr_field.h"
56 bool open(
yarp::os::Searchable& config) override;
57 bool close() override;
62 yarp::dev::ReturnValue
setVoice(const
std::
string& voice_name = "auto") override;
64 yarp::dev::ReturnValue
setSpeed(const
double speed=0) override;
66 yarp::dev::ReturnValue
setPitch(const
double pitch) override;
71 bool m_offline{
false};
72 std::shared_ptr<google::cloud::texttospeech_v1::TextToSpeechClient> m_synthClient{
nullptr};
73 std::shared_ptr<google::cloud::texttospeech::v1::SynthesisInput> m_synthInput{
nullptr};
74 std::shared_ptr<google::cloud::texttospeech::v1::VoiceSelectionParams> m_synthVoiceSelParams{
nullptr};
75 std::shared_ptr<google::cloud::texttospeech::v1::AudioConfig> m_synthAudioConfig{
nullptr};
76 google::protobuf::RepeatedPtrField<google::cloud::texttospeech::v1::Voice> m_synthVoices{
nullptr};
const std::pair PITCH_RANGE
const std::pair SPEED_RANGE
This class is the parameters parser for class GoogleSpeechSynthesizer.
googleSpeechSynthesizer: A yarp device for speech synthesis using google cloud cpp libraries
GoogleSpeechSynthesizer()
bool _voiceSupported(const std::string &voice_name)
Checks whether or not a particular voice name is supported by the currently selected language code.
yarp::dev::ReturnValue getPitch(double &pitch) override
Gets the current pitch set for speech synthesis.
GoogleSpeechSynthesizer(const GoogleSpeechSynthesizer &)=delete
yarp::dev::ReturnValue getLanguage(std::string &language) override
Gets the current language set for speech synthesis.
GoogleSpeechSynthesizer(GoogleSpeechSynthesizer &&) noexcept=delete
yarp::dev::ReturnValue setSpeed(const double speed=0) override
Sets the voice speed for speech synthesis.
yarp::dev::ReturnValue getSpeed(double &speed) override
Gets the current voice speed.
yarp::dev::ReturnValue setPitch(const double pitch) override
Sets the pitch for speech synthesis.
yarp::dev::ReturnValue setVoice(const std::string &voice_name="auto") override
Sets the voice set for speech synthesis.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue setLanguage(const std::string &language="auto") override
Sets the language for speech synthesis.
yarp::dev::ReturnValue synthesize(const std::string &text, yarp::sig::Sound &sound) override
Performs the speech synthesis.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue getVoice(std::string &voice_name) override
Gets the current voice set for speech synthesis.
Interface implemented by all device drivers.
A generic interface for speech synthesis.
The main, catch-all namespace for YARP.