YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ISpeechSynthesizer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_ISPEECHSYNTHESIZER_H
7#define YARP_DEV_ISPEECHSYNTHESIZER_H
8
9#include <yarp/dev/api.h>
10#include <yarp/sig/Sound.h>
11#include <yarp/sig/Vector.h>
13
14namespace yarp::dev {
15
22{
23public:
25
31 virtual yarp::dev::ReturnValue setLanguage(const std::string& language="auto") = 0;
32
38 virtual yarp::dev::ReturnValue getLanguage(std::string& language) = 0;
39
45 virtual yarp::dev::ReturnValue setVoice(const std::string& voice_name = "auto") = 0;
46
52 virtual yarp::dev::ReturnValue getVoice(std::string& voice_name) = 0;
53
60
66 virtual yarp::dev::ReturnValue setSpeed(const double speed=0) = 0;
67
73 virtual yarp::dev::ReturnValue getSpeed(double& speed) = 0;
74
80 virtual yarp::dev::ReturnValue setPitch(const double pitch) = 0;
81
87 virtual yarp::dev::ReturnValue getPitch(double& pitch) = 0;
88
95 virtual yarp::dev::ReturnValue synthesize(const std::string& text, yarp::sig::Sound& sound) = 0;
96};
97
98} // namespace yarp::dev
99
100#endif // YARP_DEV_ISPEECHSYNTHESIZER_H
contains the definition of a Vector type
A generic interface for speech synthesis.
virtual yarp::dev::ReturnValue synthesize(const std::string &text, yarp::sig::Sound &sound)=0
Performs the speech synthesis.
virtual yarp::dev::ReturnValue setPitch(const double pitch)=0
Sets the pitch for speech synthesis.
virtual yarp::dev::ReturnValue setVoice(const std::string &voice_name="auto")=0
Sets the voice set for speech synthesis.
virtual yarp::dev::ReturnValue setSpeed(const double speed=0)=0
Sets the voice speed for speech synthesis.
virtual yarp::dev::ReturnValue getAvailableVoices(yarp::sig::VectorOfString &available_voices)=0
Returns the list of available voices for the currently set language.
virtual yarp::dev::ReturnValue getLanguage(std::string &language)=0
Gets the current language set for speech synthesis.
virtual yarp::dev::ReturnValue setLanguage(const std::string &language="auto")=0
Sets the language for speech synthesis.
virtual yarp::dev::ReturnValue getSpeed(double &speed)=0
Gets the current voice speed.
virtual yarp::dev::ReturnValue getVoice(std::string &voice_name)=0
Gets the current voice set for speech synthesis.
virtual yarp::dev::ReturnValue getPitch(double &pitch)=0
Gets the current pitch set for speech synthesis.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Definition Sound.h:39
For streams capable of holding different kinds of content, check what they actually have.
#define YARP_dev_API
Definition api.h:18