6#ifndef YARP_TTSDEVICE_H
7#define YARP_TTSDEVICE_H
31const std::vector<std::string>
VOICES{
53 bool open(
yarp::os::Searchable& config) override;
54 bool close() override;
59 yarp::dev::ReturnValue
setVoice(const
std::
string& voice_name = "auto") override;
61 yarp::dev::ReturnValue
setSpeed(const
double speed=0) override;
63 yarp::dev::ReturnValue
setPitch(const
double pitch) override;
71 struct curl_slist *headers{
nullptr};
72 static size_t _writeCallback(
void *contents,
size_t size,
size_t nmemb, std::vector<uint8_t> *output);
73 std::string _escapeJsonString(
const std::string &input);
74 bool _voiceNameIsValid(
const std::string& voice_name);
This class is the parameters parser for class TtsDevice.
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 synthesize(const std::string &text, yarp::sig::Sound &sound) override
Performs the speech synthesis.
TtsDevice(const TtsDevice &)=delete
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue setLanguage(const std::string &language="auto") override
Sets the language for speech synthesis.
yarp::dev::ReturnValue setPitch(const double pitch) override
Sets the pitch for speech synthesis.
yarp::dev::ReturnValue getVoice(std::string &voice_name) override
Gets the current voice set for speech synthesis.
yarp::dev::ReturnValue getLanguage(std::string &language) override
Gets the current language set for speech synthesis.
TtsDevice(TtsDevice &&) noexcept=delete
yarp::dev::ReturnValue getSpeed(double &speed) override
Gets the current voice speed.
yarp::dev::ReturnValue setSpeed(const double speed=0) override
Sets the voice speed for speech synthesis.
yarp::dev::ReturnValue getPitch(double &pitch) override
Gets the current pitch set for speech synthesis.
Interface implemented by all device drivers.
A generic interface for speech synthesis.
const std::vector< std::string > VOICES
ttsDevice: A yarp device for speech synthesis using azure openai APIs
The main, catch-all namespace for YARP.