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
12namespace yarp::dev {
13
20{
21public:
23
29 virtual bool setLanguage(const std::string& language="auto") = 0;
30
36 virtual bool getLanguage(std::string& language) = 0;
37
43 virtual bool setVoice(const std::string& voice_name = "auto") = 0;
44
50 virtual bool getVoice(std::string& voice_name) = 0;
51
57 virtual bool setSpeed(const double speed=0) = 0;
58
64 virtual bool getSpeed(double& speed) = 0;
65
71 virtual bool setPitch(const double pitch) = 0;
72
78 virtual bool getPitch(double& voice) = 0;
79
86 virtual bool synthesize(const std::string& text, yarp::sig::Sound& sound) = 0;
87};
88
89} // namespace yarp::dev
90
91#endif // YARP_DEV_ISPEECHSYNTHESIZER_H
A generic interface for speech synthesis.
virtual bool setSpeed(const double speed=0)=0
Sets the voice speed for speech synthesis.
virtual bool getLanguage(std::string &language)=0
Gets the current language set for speech synthesis.
virtual bool setVoice(const std::string &voice_name="auto")=0
Sets the voice set for speech synthesis.
virtual bool getVoice(std::string &voice_name)=0
Gets the current voice set for speech synthesis.
virtual bool setLanguage(const std::string &language="auto")=0
Sets the language for speech synthesis.
virtual bool getPitch(double &voice)=0
Gets the current pitch set for speech synthesis.
virtual bool synthesize(const std::string &text, yarp::sig::Sound &sound)=0
Performs the speech synthesis.
virtual bool getSpeed(double &speed)=0
Gets the current voice speed.
virtual bool setPitch(const double pitch)=0
Sets the pitch 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.
#define YARP_dev_API
Definition api.h:18