6#ifndef YARP_WHISPERDEVICE_H
7#define YARP_WHISPERDEVICE_H
18#include <nlohmann/json.hpp>
52 bool open(
yarp::os::Searchable& config) override;
53 bool close() override;
58 yarp::dev::ReturnValue
transcribe(const
yarp::sig::Sound& sound,
std::
string& transcription,
double& score) override;
63 struct curl_slist *headers{
nullptr};
65 std::vector<uint8_t> _createWavHeader(
int sampleRate,
int numSamples);
66 static size_t _writeCallback(
void *contents,
size_t size,
size_t nmemb, std::string *output);
This class is the parameters parser for class WhisperDevice.
whisperDevice: A yarp device for speech synthesis using azure openai APIs
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.
yarp::dev::ReturnValue setLanguage(const std::string &language="auto") override
Sets the language for speech transcription.
bool close() override
Close the DeviceDriver.
WhisperDevice(WhisperDevice &&) noexcept=delete
WhisperDevice(const WhisperDevice &)=delete
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Interface implemented by all device drivers.
A generic interface for speech transcription.
The main, catch-all namespace for YARP.