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>
12
13namespace yarp::dev {
14
21{
22public:
24
30 virtual yarp::dev::ReturnValue setLanguage(const std::string& language="auto") = 0;
31
37 virtual yarp::dev::ReturnValue getLanguage(std::string& language) = 0;
38
44 virtual yarp::dev::ReturnValue setVoice(const std::string& voice_name = "auto") = 0;
45
51 virtual yarp::dev::ReturnValue getVoice(std::string& voice_name) = 0;
52
58 virtual yarp::dev::ReturnValue setSpeed(const double speed=0) = 0;
59
65 virtual yarp::dev::ReturnValue getSpeed(double& speed) = 0;
66
72 virtual yarp::dev::ReturnValue setPitch(const double pitch) = 0;
73
79 virtual yarp::dev::ReturnValue getPitch(double& voice) = 0;
80
87 virtual yarp::dev::ReturnValue synthesize(const std::string& text, yarp::sig::Sound& sound) = 0;
88};
89
90} // namespace yarp::dev
91
92#endif // YARP_DEV_ISPEECHSYNTHESIZER_H
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 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 getPitch(double &voice)=0
Gets the current pitch set 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.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Definition Sound.h:25
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
#define YARP_dev_API
Definition api.h:18