YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

whisperDevice: A yarp device for speech synthesis using azure openai APIs More...

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/opt-modules/yarp-devices-azure-openai/src/devices/whisperDevice/WhisperDevice.h>

+ Inheritance diagram for WhisperDevice:

Public Member Functions

 WhisperDevice ()
 
 WhisperDevice (const WhisperDevice &)=delete
 
 WhisperDevice (WhisperDevice &&) noexcept=delete
 
WhisperDeviceoperator= (const WhisperDevice &)=delete
 
WhisperDeviceoperator= (WhisperDevice &&) noexcept=delete
 
 ~WhisperDevice () override=default
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
yarp::dev::ReturnValue setLanguage (const std::string &language="auto") override
 Sets the language for speech transcription.
 
yarp::dev::ReturnValue getLanguage (std::string &language) override
 Gets the current language set for speech transcription.
 
yarp::dev::ReturnValue transcribe (const yarp::sig::Sound &sound, std::string &transcription, double &score) override
 Performs the speech transcription.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::ISpeechTranscription
virtual ~ISpeechTranscription ()
 
- Public Member Functions inherited from WhisperDevice_ParamsParser
 WhisperDevice_ParamsParser ()
 
 ~WhisperDevice_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Additional Inherited Members

- Public Attributes inherited from WhisperDevice_ParamsParser
const std::string m_device_classname = {"WhisperDevice"}
 
const std::string m_device_name = {"whisperDevice"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_ENVS_end_point_name_defaultValue = {"AZURE_ENDPOINT"}
 
const std::string m_ENVS_deployment_id_name_defaultValue = {"DEPLOYMENT_WHISPER_ID"}
 
const std::string m_ENVS_api_key_name_defaultValue = {"AZURE_API_KEY"}
 
const std::string m_ENVS_api_version_name_defaultValue = {"AZURE_API_VERSION_TTS"}
 
std::string m_ENVS_end_point_name = {"AZURE_ENDPOINT"}
 
std::string m_ENVS_deployment_id_name = {"DEPLOYMENT_WHISPER_ID"}
 
std::string m_ENVS_api_key_name = {"AZURE_API_KEY"}
 
std::string m_ENVS_api_version_name = {"AZURE_API_VERSION_TTS"}
 

Detailed Description

whisperDevice: A yarp device for speech synthesis using azure openai APIs

whisperDevice

Parameters required by this device are described in class WhisperDevice_ParamsParser

Definition at line 38 of file WhisperDevice.h.

Constructor & Destructor Documentation

◆ WhisperDevice() [1/3]

WhisperDevice::WhisperDevice ( )

Definition at line 25 of file WhisperDevice.cpp.

◆ WhisperDevice() [2/3]

WhisperDevice::WhisperDevice ( const WhisperDevice )
delete

◆ WhisperDevice() [3/3]

WhisperDevice::WhisperDevice ( WhisperDevice &&  )
deletenoexcept

◆ ~WhisperDevice()

WhisperDevice::~WhisperDevice ( )
overridedefault

Member Function Documentation

◆ close()

bool WhisperDevice::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 64 of file WhisperDevice.cpp.

◆ getLanguage()

ReturnValue WhisperDevice::getLanguage ( std::string &  language)
overridevirtual

Gets the current language set for speech transcription.

Parameters
languagethe returned string (code) representing the speech language (e.g. ita, eng...). Default value is "auto".
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechTranscription.

Definition at line 76 of file WhisperDevice.cpp.

◆ open()

bool WhisperDevice::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 30 of file WhisperDevice.cpp.

◆ operator=() [1/2]

WhisperDevice & WhisperDevice::operator= ( const WhisperDevice )
delete

◆ operator=() [2/2]

WhisperDevice & WhisperDevice::operator= ( WhisperDevice &&  )
deletenoexcept

◆ setLanguage()

ReturnValue WhisperDevice::setLanguage ( const std::string &  language = "auto")
overridevirtual

Sets the language for speech transcription.

Parameters
languagea string (code) representing the speech language (e.g. ita, eng...). Default value is "auto".
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechTranscription.

Definition at line 70 of file WhisperDevice.cpp.

◆ transcribe()

ReturnValue WhisperDevice::transcribe ( const yarp::sig::Sound sound,
std::string &  transcription,
double score 
)
overridevirtual

Performs the speech transcription.

Parameters
soundthe audio data to transcribe
transcriptionthe returned transcription (it may be empty)
scorethe returned score/confidence value in the range (0-1.0). It may be not implemented.
Returns
a ReturnValue, convertible to true/false

Implements yarp::dev::ISpeechTranscription.

Definition at line 82 of file WhisperDevice.cpp.


The documentation for this class was generated from the following files: