Change audio generation files accordingly (#3717)
* Change audio generation files accordingly New way of working : units files are ALWAYS named in english based on the names in audio_arm.cpp names. multiple form (singular, plural(s) are ammended with 0 to 4 suffix, according to languages rules. example : meter1.wav for first form of plural of meter unit,. This filename needs to be the same for all languages (in their respective directories of course) * Care for gruin9x * Better form * Other languages * Cosmetics
This commit is contained in:
@@ -135,6 +135,37 @@ const int16_t sineValues[] =
|
||||
};
|
||||
|
||||
#if defined(SDCARD)
|
||||
|
||||
const char * const unitsFilenames[] = {
|
||||
"",
|
||||
"volt",
|
||||
"amp",
|
||||
"mamp",
|
||||
"knot",
|
||||
"mps",
|
||||
"fps",
|
||||
"kph",
|
||||
"mph",
|
||||
"meter",
|
||||
"foot",
|
||||
"celsius",
|
||||
"fahr",
|
||||
"percent",
|
||||
"mamph",
|
||||
"watt",
|
||||
"mwatt",
|
||||
"db",
|
||||
"rpm",
|
||||
"g",
|
||||
"degree",
|
||||
"radian",
|
||||
"ml",
|
||||
"founce",
|
||||
"hour",
|
||||
"minute",
|
||||
"second",
|
||||
};
|
||||
|
||||
const char * const audioFilenames[] = {
|
||||
"hello",
|
||||
"bye",
|
||||
@@ -1235,6 +1266,22 @@ void audioEvent(unsigned int index)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
void pushUnit(uint8_t unit, uint8_t idx, uint8_t id)
|
||||
{
|
||||
if (unit < DIM(unitsFilenames)) {
|
||||
char path[AUDIO_FILENAME_MAXLEN+1];
|
||||
char *tmp = strAppendSystemAudioPath(path);
|
||||
tmp = strAppendStringWithIndex(tmp, unitsFilenames[unit], idx);
|
||||
strcpy(tmp, SOUNDS_EXT);
|
||||
audioQueue.playFile(path, 0, id);
|
||||
}
|
||||
else {
|
||||
TRACE("pushUnit: out of bounds unit : %d", unit); // We should never get here, but given the nature of TTS files, this prevent segfault in case of bug there.
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void pushPrompt(uint16_t prompt, uint8_t id)
|
||||
{
|
||||
#if defined(SDCARD)
|
||||
|
||||
Reference in New Issue
Block a user