YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
VoiceBoxSynthesizer.cpp File Reference
#include "VoiceBoxSynthesizer.h"
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include "dr_wav.h"
#include <yarp/os/LogComponent.h>
#include <yarp/os/LogStream.h>
+ Include dependency graph for VoiceBoxSynthesizer.cpp:

Go to the source code of this file.

Macros

#define _USE_MATH_DEFINES
 
#define DR_WAV_IMPLEMENTATION
 

Typedefs

using json = nlohmann::json
 

Functions

const yarp::os::LogComponent & VOICEBOXSYNTHESIZER ()
 
static yarp::sig::Sound decodedAudioToYarpSound (const DecodedAudio &audio)
 
static profilesList getProfiles (const std::string &baseUrl)
 
static bool findProfileByName (const profilesList &profiles, const std::string &name, profileMap &outProfile)
 
static std::string startGeneration (const std::string &baseUrl, const profileMap &profile, const std::string &text, const std::string &language, double speed)
 
static void waitUntilFinished (const std::string &baseUrl, const std::string &generationId, std::chrono::milliseconds pollInterval=std::chrono::milliseconds(1000), std::chrono::seconds timeout=std::chrono::seconds(120))
 
static yarp::sig::Sound downloadAudioAsYarpSound (const std::string &baseUrl, const std::string &generationId)
 
static yarp::sig::Sound synthesizeVoiceboxToYarpSound (const std::string &baseUrl, const profileMap &profile, const std::string &text, const std::string &language, double speed)
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 7 of file VoiceBoxSynthesizer.cpp.

◆ DR_WAV_IMPLEMENTATION

#define DR_WAV_IMPLEMENTATION

Definition at line 14 of file VoiceBoxSynthesizer.cpp.

Typedef Documentation

◆ json

using json = nlohmann::json

Definition at line 22 of file VoiceBoxSynthesizer.cpp.

Function Documentation

◆ decodedAudioToYarpSound()

static yarp::sig::Sound decodedAudioToYarpSound ( const DecodedAudio &  audio)
static

Definition at line 205 of file VoiceBoxSynthesizer.cpp.

◆ downloadAudioAsYarpSound()

static yarp::sig::Sound downloadAudioAsYarpSound ( const std::string &  baseUrl,
const std::string &  generationId 
)
static

Definition at line 431 of file VoiceBoxSynthesizer.cpp.

◆ findProfileByName()

static bool findProfileByName ( const profilesList &  profiles,
const std::string &  name,
profileMap &  outProfile 
)
static

Definition at line 242 of file VoiceBoxSynthesizer.cpp.

◆ getProfiles()

static profilesList getProfiles ( const std::string &  baseUrl)
static

Definition at line 231 of file VoiceBoxSynthesizer.cpp.

◆ startGeneration()

static std::string startGeneration ( const std::string &  baseUrl,
const profileMap &  profile,
const std::string &  text,
const std::string &  language,
double  speed 
)
static

Definition at line 253 of file VoiceBoxSynthesizer.cpp.

◆ synthesizeVoiceboxToYarpSound()

static yarp::sig::Sound synthesizeVoiceboxToYarpSound ( const std::string &  baseUrl,
const profileMap &  profile,
const std::string &  text,
const std::string &  language,
double  speed 
)
static

Definition at line 460 of file VoiceBoxSynthesizer.cpp.

◆ VOICEBOXSYNTHESIZER()

const yarp::os::LogComponent & VOICEBOXSYNTHESIZER ( )

Definition at line 24 of file VoiceBoxSynthesizer.cpp.

◆ waitUntilFinished()

static void waitUntilFinished ( const std::string &  baseUrl,
const std::string &  generationId,
std::chrono::milliseconds  pollInterval = std::chrono::milliseconds(1000),
std::chrono::seconds  timeout = std::chrono::seconds(120) 
)
static

Definition at line 345 of file VoiceBoxSynthesizer.cpp.