YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeSpeechTranscription_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::fakeSpeechTranscription", "[yarp::dev]")
19{
20 YARP_REQUIRE_PLUGIN("fakeSpeechTranscription", "device");
21
22 Network::setLocalMode(true);
23
24 SECTION("Checking fakeSpeechTranscription device")
25 {
28
29 //open the device
30 {
31
33 pdev_cfg.put("device", "fakeSpeechTranscription");
36
37 REQUIRE(ddfake.view(istr));
38 }
39
40 std::string lang = "eng";
41 CHECK(istr->getLanguage(lang));
42 CHECK(lang=="auto");
43
44 CHECK(istr->setLanguage("eng"));
45 CHECK(istr->getLanguage(lang));
46 CHECK(lang == "eng");
47
48 std::string transcript;
49 double score;
51 snd.resize(100, 2);
52 CHECK(istr->transcribe(snd,transcript, score));
53 CHECK(transcript=="hello world");
54 CHECK(score > 0.99);
55
56 //"Close all polydrivers and check"
57 {
60 }
61 }
62
63 Network::setLocalMode(false);
64}
A generic interface for speech transcription.
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:32
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Definition Sound.h:39
TEST_CASE("dev::fakeSpeechTranscription", "[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.