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>
10
11#include <catch2/catch_amalgamated.hpp>
12#include <harness.h>
13
14using namespace yarp::dev;
15using namespace yarp::os;
16
17TEST_CASE("dev::fakeSpeechSynthesizer", "[yarp::dev]")
18{
19 YARP_REQUIRE_PLUGIN("fakeSpeechSynthesizer", "device");
20
21 Network::setLocalMode(true);
22
23 SECTION("Checking fakeSpeechSynthesizer device")
24 {
27
28 //open the device
29 {
31 pdev_cfg.put("device", "fakeSpeechSynthesizer");
33 REQUIRE(ddfake.view(istr));
34 }
35
36 std::string lang = "eng";
37 CHECK(istr->getLanguage(lang));
38 CHECK(lang=="auto");
39
40 CHECK(istr->setLanguage("eng"));
41 CHECK(istr->getLanguage(lang));
42 CHECK(lang == "eng");
43
45 CHECK(istr->synthesize("hello world",snd));
46 CHECK(snd.getChannels()==2);
47 CHECK(snd.getSamples()==100);
48
49 //"Close all polydrivers and check"
50 {
53 }
54 }
55
56 Network::setLocalMode(false);
57}
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:25
size_t getChannels() const
Get the number of channels of the sound.
Definition Sound.cpp:603
size_t getSamples() const
Get the number of samples contained in the sound.
Definition Sound.cpp:598
TEST_CASE("dev::fakeSpeechSynthesizer", "[yarp::dev]")
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.