File tree Expand file tree Collapse file tree 6 files changed +85
-25
lines changed Expand file tree Collapse file tree 6 files changed +85
-25
lines changed Original file line number Diff line number Diff line change
1
+
2
+ /* *
3
+ * @file audio-csv.ino
4
+ * @author Phil Schatzmann
5
+ * @brief We generate the CSV output that can be used as input to the provided tools
6
+ * @version 0.1
7
+ * @date 2022-02-19
8
+ *
9
+ * @copyright Copyright (c) 2022
10
+ *
11
+ */
12
+ #include " SimpleTTS.h"
13
+
14
+ NumberToText ntt;
15
+ TimeToText ttt;
16
+
17
+ void setup () {
18
+ Serial.begin (115200 );
19
+ Serial.println (" Name, Text" );
20
+ ntt.printCSV (Serial);
21
+ ttt.printCSV (Serial);
22
+ }
23
+
24
+ void loop (){
25
+
26
+ }
Original file line number Diff line number Diff line change @@ -97,19 +97,6 @@ class AudioDictionarySD : public AudioDictionaryBase {
97
97
return nullptr ;
98
98
}
99
99
100
- // Creates all missing audio recording files for the indicated source
101
- void printCSV (SimpleTTSBase &source, const char *url, const char *mime) {
102
- auto texts = source.allTexts ();
103
- Serial.println ();
104
- Serial.println (" Audio Data:" );
105
- for (auto txt : texts) {
106
- Serial.print (txt);
107
- Serial.print (" , " );
108
- Serial.println (getFileWithPath (txt));
109
- }
110
- Serial.println ();
111
- }
112
-
113
100
protected:
114
101
audio_tools::StrExt url_with_text;
115
102
AudioFile file;
Original file line number Diff line number Diff line change @@ -21,6 +21,19 @@ class SimpleTTSBase {
21
21
reference = ref;
22
22
}
23
23
24
+ // Creates all missing audio recording files for the indicated source
25
+ void printCSV (Print &out) {
26
+ for (auto txt : allTexts ()) {
27
+ if (txt!=nullptr && strlen (txt)>0 ){
28
+ out.print (txt);
29
+ out.print (" , " );
30
+ StrExt str = txt;
31
+ str.toLowerCase (); // convert txt to lowercase
32
+ out.println (str.c_str ());
33
+ }
34
+ }
35
+ }
36
+
24
37
protected:
25
38
void (*callback)(audio_tools::Vector<const char *> word, void * ref) = nullptr;
26
39
void * reference = nullptr ;
Original file line number Diff line number Diff line change @@ -46,13 +46,6 @@ class TimeToText : public SimpleTTSBase {
46
46
for (int j = 0 ; j < 10 ; j++) {
47
47
add (j);
48
48
}
49
- // add all numbers
50
- addAll (ntt.allTexts ());
51
-
52
- // provide result to callback
53
- if (callback) {
54
- callback (result, reference);
55
- }
56
49
return result;
57
50
}
58
51
File renamed without changes.
Original file line number Diff line number Diff line change 1
- Name,Text
2
- one,one
3
- two,two
4
- @menu1,This is menu 1
5
- @menu2,This is menu 2
1
+ Name, Text
2
+ ZERO, zero
3
+ ONE, one
4
+ TWO, two
5
+ THREE, three
6
+ FOUR, four
7
+ FIVE, five
8
+ SIX, six
9
+ SEVEN, seven
10
+ EIGHT, eight
11
+ NINE, nine
12
+ TEN, ten
13
+ ELEVEN, eleven
14
+ TWELVE, twelve
15
+ THIRTEEN, thirteen
16
+ FOURTEEN, fourteen
17
+ FIFTEEN, fifteen
18
+ SIXTEEN, sixteen
19
+ SEVENTEEN, seventeen
20
+ EIGHTTEEN, eightteen
21
+ NINETEEN, nineteen
22
+ TEN, ten
23
+ TWENTY, twenty
24
+ THIRTY, thirty
25
+ FORTY, forty
26
+ FIFTY, fifty
27
+ SIXTY, sixty
28
+ SEVENTY, seventy
29
+ EIGHTY, eighty
30
+ NINETY, ninety
31
+ HUNDRED, hundred
32
+ THOUSAND, thousand
33
+ MILLION, million
34
+ AND, and
35
+ DOT, dot
36
+ MINUS, minus
37
+ ITS, its
38
+ NOON, noon
39
+ MIDNIGHT, midnight
40
+ OCLOCK, oclock
41
+ TO, to
42
+ PAST, past
43
+ AM, am
44
+ PM, pm
45
+ HALF, half
46
+ QUARTER, quarter
You can’t perform that action at this time.
0 commit comments