Skip to content

Commit

Permalink
Test speechTranscription_nws_yarp
Browse files Browse the repository at this point in the history
  • Loading branch information
elandini84 committed Jul 12, 2023
1 parent df8be48 commit 7d16c5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/devices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ yarp_begin_plugin_library(yarpmod
add_subdirectory(fakeNavigationDevice)
add_subdirectory(serialPort_nws_yarp)
add_subdirectory(serialPort_nwc_yarp)
add_subdirectory(speechSynthesizer_nws_yarp)
add_subdirectory(speechSynthesizer_nwc_yarp)
#add_subdirectory(speechSynthesizer_nws_yarp)
#add_subdirectory(speechSynthesizer_nwc_yarp)
add_subdirectory(speechTranscription_nws_yarp)
add_subdirectory(speechTranscription_nwc_yarp)
#add_subdirectory(speechTranscription_nwc_yarp)
add_subdirectory(RemoteControlBoard)
add_subdirectory(AnalogSensorClient)
add_subdirectory(AnalogWrapper)
Expand Down
16 changes: 8 additions & 8 deletions src/devices/fakeSpeechTranscription/fakeSpeechTranscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ bool FakeSpeechTranscription::getLanguage(std::string& language)

bool FakeSpeechTranscription::transcribe(const yarp::sig::Sound& sound, std::string& transcription, double& score)
{
if (sound.getSamples() == 0 ||
sound.getChannels() == 0)
{
yCError(FAKE_SPEECHTR) << "Invalid Sound sample received";
transcription = "";
score = 0.0;
return false;
}
// if (sound.getSamples() == 0 ||
// sound.getChannels() == 0)
// {
// yCError(FAKE_SPEECHTR) << "Invalid Sound sample received";
// transcription = "";
// score = 0.0;
// return false;
// }

transcription = "hello world";
score = 1.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ TEST_CASE("dev::speechTranscription_nws_yarp", "[yarp::dev]")
CHECK(Network::connect("/speechTranscription_nws/text:o", "/test:i"));
yarp::os::Time::delay(0.5);

yarp::sig::Sound s;
s.resize(100, 2);
yarp::sig::Sound s(2);
//s.resize(100, 2);
CHECK(po.write(s));
yarp::os::Time::delay(0.5);
yarp::os::Bottle b;
Expand Down

0 comments on commit 7d16c5b

Please sign in to comment.