30 std::string thriftClientPortName =
m_local +
"/thrift:c";
31 std::string thriftServerPortName =
m_remote +
"/rpc";
35 yCError(SPEECHTR_NWC) <<
"open() failed: could not open" << thriftClientPortName <<
"check the network";
42 yCError(SPEECHTR_NWC) <<
"Network::connect() failed: could not connect" << thriftClientPortName <<
"with" << thriftServerPortName;
49 yCError(SPEECHTR_NWC) <<
"Error! Cannot attach the m_thriftClientPort (" << thriftClientPortName <<
") port as a client";
57bool SpeechTranscription_nwc_yarp::closeMain()
70 yCError(SPEECHTR_NWC) <<
"Error while setting language to" << language;
83 yCError(SPEECHTR_NWC) <<
"Error while retrieving language";
102 yCError(SPEECHTR_NWC) <<
"Error while transcribing the audio signal";
107 score = result.
score;
virtual return_transcribe transcribe(const yarp::sig::Sound &sound)
virtual return_set_language set_language(const std::string &language)
virtual return_get_language get_language()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
yarp::dev::ReturnValue setLanguage(const std::string &language="auto") override
Sets the language for speech transcription.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue getLanguage(std::string &language) override
Gets the current language set for speech transcription.
virtual ~SpeechTranscription_nwc_yarp() override
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue transcribe(const yarp::sig::Sound &sound, std::string &transcription, double &score) override
Performs the speech transcription.
yarp::os::Port m_thriftClientPort
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
std::string transcription
yarp::dev::ReturnValue ret
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
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 base class for nested structures that can be searched.
bool attachAsClient(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a client, sending data via the specified port.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)