Your code needs this line to be defined in voice file: "The speed limit has lowered."Quote:
Originally Posted by urbexuk [Only registered and activated users can see links. Click Here To Register...]
Else this function will return allways FALSE.
Code:sc_wReadOutSpeedLimitSupported = function()
return MODEL.regional.is_it_voice_localizable(m_i18n_voice("The speed limit has lowered.")) and MODEL.regional.is_it_voice_localizable(m_i18n_voice("Limit %s")) and MODEL.regional.current_voice.is_tts()
end
Change this code:
Code:sc_wspeedmode_change = function()
if MODEL.lua.wSimulateIsTrackPlaying() then
return
end
if MODEL.warning.driveralert.speed_limit() and MODEL.lua.wSpeedLimit() and MODEL.warning.driveralert.speed_limit() < MODEL.lua.wSpeedLimit() and MODEL.warning.driveralert.speed_limit() < MODEL.navigation.car.current_speed() then
MODEL.lua.wSpeedLimit = MODEL.warning.driveralert.speed_limit()
sc_StartTimerSL()
if MODEL.lua.wSLTTSVoice() and sc_wReadOutSpeedLimitSupported() then
sc_wspeedlimitsayspeech(sc_wGetSL_sayphase(MODEL.lua.wSpeedLimit()))
else
sc_wplaysound(0, MODEL.lua.wSLSoundName(), MODEL.lua.wSLSoundVolume())
end
else
sc_StopTimerSL()
MODEL.lua.wSpeedLimit = MODEL.warning.driveralert.speed_limit()
end
end
To this code:
Code:sc_wspeedmode_change = function()
if MODEL.lua.wSimulateIsTrackPlaying() then
return
end
if MODEL.warning.driveralert.speed_limit() and MODEL.lua.wSpeedLimit() and MODEL.warning.driveralert.speed_limit() > MODEL.lua.wSpeedLimit() and MODEL.warning.driveralert.speed_limit() > MODEL.navigation.car.current_speed() then
MODEL.lua.wSpeedLimit = MODEL.warning.driveralert.speed_limit()
sc_StartTimerSL()
if MODEL.lua.wSLTTSVoice() and sc_wReadOutSpeedLimitSupported() then
sc_wspeedlimitsayspeech(sc_wGetSL_sayphase(MODEL.lua.wSpeedLimit()))
else
sc_wplaysound(0, MODEL.lua.wSLSoundName(), MODEL.lua.wSLSoundVolume())
end
else
if MODEL.warning.driveralert.speed_limit() and MODEL.lua.wSpeedLimit() and MODEL.warning.driveralert.speed_limit() < MODEL.lua.wSpeedLimit() and MODEL.warning.driveralert.speed_limit() > MODEL.navigation.car.current_speed() then
MODEL.lua.wSpeedLimit = MODEL.warning.driveralert.speed_limit()
sc_StartTimerSL()
if MODEL.lua.wSLTTSVoice() and sc_wReadOutSpeedLimitSupported2() then
sc_wspeedlimitsayspeech(sc_wGetSL_sayphase2(MODEL.lua.wSpeedLimit()))
else
sc_wplaysound(0, MODEL.lua.wSLSoundName(), MODEL.lua.wSLSoundVolume())
end
else
sc_StopTimerSL()
MODEL.lua.wSpeedLimit = MODEL.warning.driveralert.speed_limit()
end
end
end
sc_wReadOutSpeedLimitSupported2 = function()
return MODEL.regional.is_it_voice_localizable(m_i18n_voice("The speed limit has lowered.")) and MODEL.regional.is_it_voice_localizable(m_i18n_voice("Limit %s")) and MODEL.regional.current_voice.is_tts()
end
sc_wGetSL_sayphase2 = function(limit)
local limitphrasepart = (MODEL.lua.wCorrectionSpeedUnit() and sc_wCorrectionSpeedUnitSupported() or not MODEL.lua.wSLTTSVoiceSecondPhraseUnit()) and 2 or 0
local limitphraseunit = MODEL.lua.wSLTTSVoiceSecondPhraseUnit() and MODEL.lua.wCorrectionSpeedUnit() and sc_wCorrectionSpeedUnitSupported() and sc_wtranslateunit(MODEL.other.format_speed(limit, MODEL.regional.units(), 1, 1), wspeed_units) or L""
local limitphrase = MODEL.lua.wSLTTSVoiceSecondPhrase() and translated_voice_format(m_i18n_voice("Limit %s"), sc_wTransform_numbers2text(MODEL.other.format_speed(limit, MODEL.regional.units(), 1, limitphrasepart), limitphrasepart) .. limitphraseunit) or L""
return translate_voice("The speed limit has lowered.") .. L" " .. limitphrase
end
And test. :)