17 virtual audio_tools::Vector<const char*>& allTexts() = 0;
18 virtual void registerCallback(
19 void (*ptr)(audio_tools::Vector<const char*> words,
void* refx),
27 void printCSV(Print &out) {
28 for (
auto txt : allTexts()) {
29 if (txt!=
nullptr && strlen(txt)>0){
32 out.print(str.c_str());
34 out.println(str.c_str());
40 void (*callback)(audio_tools::Vector<const char*> word,
void* ref) =
nullptr;
41 void* reference =
nullptr;
51 virtual AudioStream* get(
const char* word) = 0;
74 const char* text =
nullptr;
89 this->minute = minutes;
92 return alt.hour == hour && alt.minute == minute;
95 return alt.hour != hour || alt.minute != minute;
108 void set(
double value,
int digits=2) {
111 sprintf(format,
"%%0.%df", digits);
112 LOGD(
"format: %s", format);
113 memset(buffer, 0, buffer_len);
115 sprintf(buffer, format, value);
116 LOGD(
"number: %s",buffer);
117 dot = strchr(buffer,
'.');
123 dot = buffer+strlen(buffer);
130 void set(int64_t wholeNumber) {
131 memset(buffer,0,buffer_len);
133 sprintf(buffer,
"%lld", wholeNumber);
135 dot = buffer+strlen(buffer);
150 const char* decAsInt(
const char* decimals,
int digits){
151 memset(buffer, 0, buffer_len);
152 memset(buffer,
'0', digits);
153 int len = min((
int)strlen(decimals),digits);
154 memcpy(buffer, decimals, len);
160 static const int buffer_len = 100;
161 char buffer[buffer_len];
Dictionary which provides a Stream of Audio for the indicated word.
Definition: SimpleTTSBase.h:49
Convert numbers to string and provide integer and decimals.
Definition: SimpleTTSBase.h:106
const char * intValue()
provides the full number
Definition: SimpleTTSBase.h:139
const char * decValues()
provides the decimals after the .
Definition: SimpleTTSBase.h:144
Common Functionality for TTS classes.
Definition: SimpleTTSBase.h:15
An Entry for the in Memory Audio Dictionary.
Definition: SimpleTTSBase.h:60
An Entry for the in Memory Audio Dictionary which contains the full text.
Definition: SimpleTTSBase.h:72
Just a simple structure with the hour and minutes.
Definition: SimpleTTSBase.h:83