30 if (m_classInstance!=
NULL)
32 for (
long int i = 0; i < m_classInstance->ob_refcnt; ++i)
46 m_path = config.
find(
"modulePath").asString();
57 yInfo() <<
"Calling Py_Initialize from open()";
87 if (! classInstanceCreator(m_moduleName, m_className,
pClassArgs, m_classInstance))
111 yInfo() <<
"Calling Close Py_Initialize";
143 yInfo()<<
"Calling setLanguage Py_Initialize";
156 return ReturnValue::return_code::return_value_error_generic;
160 if (!boolWrapper(
pRetVal, result))
163 return ReturnValue::return_code::return_value_error_generic;
168 for (
long int i = 0; i <
pInput->ob_refcnt; ++i)
174 yInfo() <<
"Returning from setLanguage: " << result;
183 yInfo()<<
"Calling getLanguage Py_Initialize";
194 return ReturnValue::return_code::return_value_error_generic;
201 return ReturnValue::return_code::return_value_error_generic;
204 yInfo() <<
"Returning from getLanguage: " <<
ret;
219 return ReturnValue::return_code::return_value_error_method_failed;
222 transcription =
"hello world";
231 yInfo()<<
"Calling functionWrapper Py_Initialize";
298 yInfo()<<
"Calling classWrapper Py_Initialize";
344 yInfo()<<
"Calling classWrapper Py_Initialize";
385 yCError(
FAKE_SPEECHTR) <<
"[classWrapper] Unable to instantiate Class with given class arguments \n";
405bool FakePythonSpeechTranscription::stringWrapper(
PyObject* &
pValue, std::string &
ret)
414 yCError(
FAKE_SPEECHTR) <<
"Null pValue passed to FakePythonSpeechTranscription::stringWrapper \n";
442 yCError(
FAKE_SPEECHTR) <<
"Null pValue passed to FakePythonSpeechTranscription::doubleWrapper \n";
456 yCError(
FAKE_SPEECHTR) <<
"Null pValue passed to FakePythonSpeechTranscription::boolWrapper \n";
virtual yarp::dev::ReturnValue transcribe(const yarp::sig::Sound &sound, std::string &transcription, double &score) override
Performs the speech transcription.
FakePythonSpeechTranscription()
bool close() override
Close the DeviceDriver.
virtual yarp::dev::ReturnValue getLanguage(std::string &language) override
Gets the current language set for speech transcription.
virtual ~FakePythonSpeechTranscription()
virtual yarp::dev::ReturnValue setLanguage(const std::string &language) override
Sets the language for speech transcription.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
A mini-server for performing network communication in the background.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
A single value (typically within a Bottle).
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
size_t getChannels() const
Get the number of channels of the sound.
size_t getSamples() const
Get the number of samples contained in the sound.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.