YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeSpeechSynthesizer_test.cpp
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
7#include <yarp/os/Network.h>
11
12#include <catch2/catch_amalgamated.hpp>
13#include <harness.h>
14
15using namespace yarp::dev;
16using namespace yarp::os;
17
18TEST_CASE("dev::fakeSpeechSynthesizer", "[yarp::dev]")
19{
20 YARP_REQUIRE_PLUGIN("fakeSpeechSynthesizer", "device");
21
22 Network::setLocalMode(true);
23
24 SECTION("Checking fakeSpeechSynthesizer device")
25 {
28
29 //open the device
30 {
32 pdev_cfg.put("device", "fakeSpeechSynthesizer");
35
36 REQUIRE(ddfake.view(istr));
37 }
38
39 std::string lang = "eng";
40 CHECK(istr->getLanguage(lang));
41 CHECK(lang=="auto");
42
43 CHECK(istr->setLanguage("eng"));
44 CHECK(istr->getLanguage(lang));
45 CHECK(lang == "eng");
46
48 CHECK(istr->synthesize("hello world",snd));
49 CHECK(snd.getChannels()==2);
50 CHECK(snd.getSamples()==100);
51
52 //"Close all polydrivers and check"
53 {
56 }
57 }
58
59 Network::setLocalMode(false);
60}
A generic interface for speech synthesis.
A container for a device driver.
Definition PolyDriver.h:23
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A class for storing options and configuration information.
Definition Property.h:33
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Definition Sound.h:42
TEST_CASE("dev::fakeSpeechSynthesizer", "[yarp::dev]")
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13