Fixed VOICE ID values.

This commit is contained in:
Dual Tachyon 2023-08-15 11:02:03 +01:00
parent 061a689374
commit 396c2b122d
3 changed files with 86 additions and 81 deletions

View File

@ -182,14 +182,14 @@ void AUDIO_PlaySingleVoice(bool bFlag)
goto Bailout;
}
Delay = VoiceClipLengthChinese[VoiceID];
VoiceID += 0x10;
VoiceID += VOICE_ID_CHI_BASE;
} else {
// English
if (VoiceID >= sizeof(VoiceClipLengthEnglish)) {
goto Bailout;
}
Delay = VoiceClipLengthEnglish[VoiceID];
VoiceID += 0x60;
VoiceID += VOICE_ID_ENG_BASE;
}
if (gCurrentFunction == FUNCTION_4 || gCurrentFunction == FUNCTION_2) {

157
audio.h
View File

@ -29,83 +29,88 @@ enum BEEP_Type_t {
typedef enum BEEP_Type_t BEEP_Type_t;
enum {
VOICE_ID_CHI_BASE = 0x10U,
VOICE_ID_ENG_BASE = 0x60U,
};
enum VOICE_ID_t {
VOICE_ID_ENG_0 = 0x60U,
VOICE_ID_ENG_1 = 0x61U,
VOICE_ID_ENG_2 = 0x62U,
VOICE_ID_ENG_3 = 0x63U,
VOICE_ID_ENG_4 = 0x64U,
VOICE_ID_ENG_5 = 0x65U,
VOICE_ID_ENG_6 = 0x66U,
VOICE_ID_ENG_7 = 0x67U,
VOICE_ID_ENG_8 = 0x68U,
VOICE_ID_ENG_9 = 0x69U,
VOICE_ID_ENG_10 = 0x6AU,
VOICE_ID_ENG_100 = 0x6BU,
VOICE_ID_ENG_WELCOME = 0x6CU,
VOICE_ID_ENG_LOCK = 0x6DU,
VOICE_ID_ENG_M_LOCK = 0x6EU,
VOICE_ID_ENG_SCANNING_BEGIN = 0x6FU,
VOICE_ID_ENG_SCANNING_STOP = 0x70U,
VOICE_ID_ENG_SCRAMBLER_ON = 0x71U,
VOICE_ID_ENG_SCRAMBLER_OFF = 0x72U,
VOICE_ID_ENG_FUNCTION = 0x73U,
VOICE_ID_ENG_CTCSS = 0x74U,
VOICE_ID_ENG_DCS = 0x75U,
VOICE_ID_ENG_POWER = 0x76U,
VOICE_ID_ENG_SAVE_MODE = 0x77U,
VOICE_ID_ENG_MEMORY_CHANNEL = 0x78U,
VOICE_ID_ENG_DELETE_CHANNEL = 0x79U,
VOICE_ID_ENG_FREQUENCY_STEP = 0x7AU,
VOICE_ID_ENG_SQUELCH = 0x7BU,
VOICE_ID_ENG_TRANSMIT_OVER_TIME = 0x7CU,
VOICE_ID_ENG_BACKLIGHT_SELECTION = 0x7DU,
VOICE_ID_ENG_VOX = 0x7EU,
VOICE_ID_ENG_FREQUENCY_DIRECTION = 0x7FU,
VOICE_ID_ENG_OFFSET_FREQUENCY = 0x80U,
VOICE_ID_ENG_TRANSMITING_MEMORY = 0x81U,
VOICE_ID_ENG_RECEIVING_MEMORY = 0x82U,
VOICE_ID_ENG_EMERGENCY_CALL = 0x83U,
VOICE_ID_ENG_LOW_VOLTAGE = 0x84U,
VOICE_ID_ENG_CHANNEL_MODE = 0x85U,
VOICE_ID_ENG_FREQUENCY_MODE = 0x86U,
VOICE_ID_ENG_VOICE_PROMPT = 0x87U,
VOICE_ID_ENG_BAND_SELECTION = 0x88U,
VOICE_ID_ENG_DUAL_STANDBY = 0x89U,
VOICE_ID_ENG_CHANNEL_BANDWIDTH = 0x8AU,
VOICE_ID_ENG_OPTIONAL_SIGNAL = 0x8BU,
VOICE_ID_ENG_MUTE_MODE = 0x8CU,
VOICE_ID_ENG_BUSY_LOCKOUT = 0x8DU,
VOICE_ID_ENG_BEEP_PROMPT = 0x8EU,
VOICE_ID_ENG_ANI_CODE = 0x8FU,
VOICE_ID_ENG_INITIALISATION = 0x90U,
VOICE_ID_ENG_CONFIRM = 0x91U,
VOICE_ID_ENG_CANCEL = 0x92U,
VOICE_ID_ENG_ON = 0x93U,
VOICE_ID_ENG_OFF = 0x94U,
VOICE_ID_ENG_2_TONE = 0x95U,
VOICE_ID_ENG_5_TONE = 0x96U,
VOICE_ID_ENG_DIGITAL_SIGNAL = 0x97U,
VOICE_ID_ENG_REPEATER = 0x98U,
VOICE_ID_ENG_MENU = 0x99U,
VOICE_ID_ENG_11 = 0x9AU,
VOICE_ID_ENG_12 = 0x9BU,
VOICE_ID_ENG_13 = 0x9CU,
VOICE_ID_ENG_14 = 0x9DU,
VOICE_ID_ENG_15 = 0x9EU,
VOICE_ID_ENG_16 = 0x9FU,
VOICE_ID_ENG_17 = 0xA0U,
VOICE_ID_ENG_18 = 0xA1U,
VOICE_ID_ENG_19 = 0xA2U,
VOICE_ID_ENG_20 = 0xA3U,
VOICE_ID_ENG_30 = 0xA4U,
VOICE_ID_ENG_40 = 0xA5U,
VOICE_ID_ENG_50 = 0xA6U,
VOICE_ID_ENG_60 = 0xA7U,
VOICE_ID_ENG_70 = 0xA8U,
VOICE_ID_ENG_80 = 0xA9U,
VOICE_ID_ENG_90 = 0xAAU,
VOICE_ID_ENG_END = 0xABU,
VOICE_ID_0 = 0x00U,
VOICE_ID_1 = 0x01U,
VOICE_ID_2 = 0x02U,
VOICE_ID_3 = 0x03U,
VOICE_ID_4 = 0x04U,
VOICE_ID_5 = 0x05U,
VOICE_ID_6 = 0x06U,
VOICE_ID_7 = 0x07U,
VOICE_ID_8 = 0x08U,
VOICE_ID_9 = 0x09U,
VOICE_ID_10 = 0x0AU,
VOICE_ID_100 = 0x0BU,
VOICE_ID_WELCOME = 0x0CU,
VOICE_ID_LOCK = 0x0DU,
VOICE_ID_M_LOCK = 0x0EU,
VOICE_ID_SCANNING_BEGIN = 0x0FU,
VOICE_ID_SCANNING_STOP = 0x10U,
VOICE_ID_SCRAMBLER_ON = 0x11U,
VOICE_ID_SCRAMBLER_OFF = 0x12U,
VOICE_ID_FUNCTION = 0x13U,
VOICE_ID_CTCSS = 0x14U,
VOICE_ID_DCS = 0x15U,
VOICE_ID_POWER = 0x16U,
VOICE_ID_SAVE_MODE = 0x17U,
VOICE_ID_MEMORY_CHANNEL = 0x18U,
VOICE_ID_DELETE_CHANNEL = 0x19U,
VOICE_ID_FREQUENCY_STEP = 0x1AU,
VOICE_ID_SQUELCH = 0x1BU,
VOICE_ID_TRANSMIT_OVER_TIME = 0x1CU,
VOICE_ID_BACKLIGHT_SELECTION = 0x1DU,
VOICE_ID_VOX = 0x1EU,
VOICE_ID_FREQUENCY_DIRECTION = 0x1FU,
VOICE_ID_OFFSET_FREQUENCY = 0x20U,
VOICE_ID_TRANSMITING_MEMORY = 0x21U,
VOICE_ID_RECEIVING_MEMORY = 0x22U,
VOICE_ID_EMERGENCY_CALL = 0x23U,
VOICE_ID_LOW_VOLTAGE = 0x24U,
VOICE_ID_CHANNEL_MODE = 0x25U,
VOICE_ID_FREQUENCY_MODE = 0x26U,
VOICE_ID_VOICE_PROMPT = 0x27U,
VOICE_ID_BAND_SELECTION = 0x28U,
VOICE_ID_DUAL_STANDBY = 0x29U,
VOICE_ID_CHANNEL_BANDWIDTH = 0x2AU,
VOICE_ID_OPTIONAL_SIGNAL = 0x2BU,
VOICE_ID_MUTE_MODE = 0x2CU,
VOICE_ID_BUSY_LOCKOUT = 0x2DU,
VOICE_ID_BEEP_PROMPT = 0x2EU,
VOICE_ID_ANI_CODE = 0x2FU,
VOICE_ID_INITIALISATION = 0x30U,
VOICE_ID_CONFIRM = 0x31U,
VOICE_ID_CANCEL = 0x32U,
VOICE_ID_ON = 0x33U,
VOICE_ID_OFF = 0x34U,
VOICE_ID_2_TONE = 0x35U,
VOICE_ID_5_TONE = 0x36U,
VOICE_ID_DIGITAL_SIGNAL = 0x37U,
VOICE_ID_REPEATER = 0x38U,
VOICE_ID_MENU = 0x39U,
VOICE_ID_11 = 0x3AU,
VOICE_ID_12 = 0x3BU,
VOICE_ID_13 = 0x3CU,
VOICE_ID_14 = 0x3DU,
VOICE_ID_15 = 0x3EU,
VOICE_ID_16 = 0x3FU,
VOICE_ID_17 = 0x40U,
VOICE_ID_18 = 0x41U,
VOICE_ID_19 = 0x42U,
VOICE_ID_20 = 0x43U,
VOICE_ID_30 = 0x44U,
VOICE_ID_40 = 0x45U,
VOICE_ID_50 = 0x46U,
VOICE_ID_60 = 0x47U,
VOICE_ID_70 = 0x48U,
VOICE_ID_80 = 0x49U,
VOICE_ID_90 = 0x4AU,
VOICE_ID_END = 0x4BU,
};
typedef enum VOICE_ID_t VOICE_ID_t;

6
main.c
View File

@ -185,13 +185,13 @@ void Main(void)
GPIO_ClearBit(&GPIOA->DATA, 12);
g_2000036F = 1;
AUDIO_SetVoiceID(0, VOICE_ID_ENG_WELCOME);
AUDIO_SetVoiceID(0, VOICE_ID_WELCOME);
Channel = gEeprom.EEPROM_0E80_0E83[gEeprom.TX_CHANNEL] + 1;
if (Channel < 201) {
AUDIO_SetVoiceID(1, VOICE_ID_ENG_CHANNEL_MODE);
AUDIO_SetVoiceID(1, VOICE_ID_CHANNEL_MODE);
AUDIO_SetDigitVoice(2, Channel);
} else if ((Channel - 201) < 7) {
AUDIO_SetVoiceID(1, VOICE_ID_ENG_FREQUENCY_MODE);
AUDIO_SetVoiceID(1, VOICE_ID_FREQUENCY_MODE);
}
AUDIO_PlaySingleVoice(0);
RADIO_ConfigureNOAA();