diff --git a/src/Makefile b/src/Makefile index 587b8bd9e..571a42d5f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -281,6 +281,9 @@ EXTRAINCDIRS = . translations CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS) +# TTS language +CPPDEFS += -DTTS_$(TTS) + ifeq ($(UNITS), IMPERIAL) CPPDEFS += -DIMPERIAL_UNITS endif diff --git a/src/open9x.cpp b/src/open9x.cpp index 4c09ca0cd..c6a992b9a 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -1886,7 +1886,11 @@ void evalFunctions() if (tmr10ms - s_last_play >= 100) { s_last_play = tmr10ms; if (sd->func == FUNC_PLAY_TRACK) +#if defined(TTS_CZ) && defined(PCBSTD) + putVoiceQueueUpper(PROMPT_CUSTOM_BASE+sd->param); +#else pushPrompt(PROMPT_CUSTOM_BASE+sd->param); +#endif else playValue(sd->param); } diff --git a/src/stock/audio.h b/src/stock/audio.h index 3f65c39bb..234312106 100644 --- a/src/stock/audio.h +++ b/src/stock/audio.h @@ -118,6 +118,16 @@ void audioDefevent(uint8_t e); #define AUDIO_WARNING2() audioDefevent(AU_WARNING2) #define AUDIO_ERROR() audioDefevent(AU_ERROR) #if defined(VOICE) +#if defined(TTS_CZ) && defined(PCBSTD) +#define AUDIO_TADA() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TADA) +#define AUDIO_TX_BATTERY_LOW() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW) +#define AUDIO_INACTIVITY() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_INACTIVITY) +#define AUDIO_ERROR_MESSAGE(e) putVoiceQueueUpper(PROMPT_SYSTEM_BASE+e) +#define AUDIO_TIMER_30() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_30) +#define AUDIO_TIMER_20() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_20) +#define AUDIO_TIMER_10() putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_10) +#define AUDIO_TIMER_LT3(x) putVoiceQueueUpper(PROMPT_SYSTEM_BASE+AU_TIMER_LT3) +#else #define AUDIO_TADA() pushPrompt(PROMPT_SYSTEM_BASE+AU_TADA) #define AUDIO_TX_BATTERY_LOW() pushPrompt(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW) #define AUDIO_INACTIVITY() pushPrompt(PROMPT_SYSTEM_BASE+AU_INACTIVITY) @@ -126,6 +136,7 @@ void audioDefevent(uint8_t e); #define AUDIO_TIMER_20() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_20) #define AUDIO_TIMER_10() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_10) #define AUDIO_TIMER_LT3(x) pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_LT3) +#endif #else #define AUDIO_TADA() #define AUDIO_TX_BATTERY_LOW() audioDefevent(AU_TX_BATTERY_LOW) diff --git a/src/stock/voice.h b/src/stock/voice.h index 7edcb31dd..6972641b8 100644 --- a/src/stock/voice.h +++ b/src/stock/voice.h @@ -48,8 +48,13 @@ #define V_WAIT_BUSY_OFF 4 #define V_WAIT_BUSY_DELAY 5 +#if defined(TTS_CZ) && defined(PCBSTD) +#define PROMPT_SYSTEM_BASE 0 +#define PROMPT_CUSTOM_BASE 40 +#else #define PROMPT_SYSTEM_BASE 170 #define PROMPT_CUSTOM_BASE 200 +#endif struct t_voice { @@ -67,7 +72,9 @@ struct t_voice void voice_process( void ) ; }; - +#if defined(TTS_CZ) +extern void putVoiceQueueUpper( uint8_t value ); +#endif extern void pushPrompt( uint8_t value ); extern struct t_voice *voiceaddress( void ) ; extern struct t_voice Voice ; diff --git a/src/translations/tts_cz.cpp b/src/translations/tts_cz.cpp index b720954ed..4ec2aeb3c 100644 --- a/src/translations/tts_cz.cpp +++ b/src/translations/tts_cz.cpp @@ -132,11 +132,17 @@ void playNumber(int16_t number, uint8_t unit, uint8_t att) int8_t mode = MODE(att); if (mode > 0) { - div_t qr = div(number, (mode == 1 ? 10 : 100)); - playNumber(qr.quot); - pushUnitPrompt(qr.quot,PROMPT_CELA); - playNumber(qr.rem,0,ZENSKY); - pushPrompt(PROMPT_UNITS_BASE+((unit-1)*4)+3); + div_t qr = div(number, (mode == 1 ? 10 : 100)); + if (qr.rem) { + playNumber(qr.quot); + pushUnitPrompt(qr.quot,PROMPT_CELA); + if (mode != 1 && qr.rem < 10) + pushPrompt (PROMPT_NULA); + playNumber(qr.rem,0,ZENSKY); + pushPrompt(PROMPT_UNITS_BASE+((unit-1)*4)+3); + } + else + playNumber(qr.quot, unit); return; }