From 4f739d98b07137c5fc8ad1d82da8b722805be7b1 Mon Sep 17 00:00:00 2001 From: thesupertechie Date: Sat, 29 Nov 2025 22:05:30 -0800 Subject: [PATCH] [tts] Change notification to 400-700 m Signed-off-by: thesupertechie --- data/sound-strings/en.json/localize.json | 4 +++- libs/routing/turns_notification_manager.cpp | 8 ++++---- libs/routing/turns_sound_settings.hpp | 2 +- libs/routing/turns_tts_text.cpp | 9 ++++++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/data/sound-strings/en.json/localize.json b/data/sound-strings/en.json/localize.json index 98b87893b..8b40aa151 100644 --- a/data/sound-strings/en.json/localize.json +++ b/data/sound-strings/en.json/localize.json @@ -104,5 +104,7 @@ "in_1_mile":"In one mile", "in_1_5_miles":"In one and a half miles", "in_2_miles":"In two miles", -"unknown_camera":"Camera ahead" +"unknown_camera":"Camera ahead", +"continue":"Continue on the current road until further instructions.", +"continue_street":"Continue on" } diff --git a/libs/routing/turns_notification_manager.cpp b/libs/routing/turns_notification_manager.cpp index d5551b1a6..78a81371e 100644 --- a/libs/routing/turns_notification_manager.cpp +++ b/libs/routing/turns_notification_manager.cpp @@ -16,7 +16,7 @@ namespace { // If the distance between two sequential turns is less than kSecondTurnThresholdDistM // the information about the second turn will be shown or pronounced -// when the user is approaching to the first one with "Then.". +// when the user is approaching to the first one with "Then,". double constexpr kSecondTurnThresholdDistM = 400.0; // If the distance between two sequential turns is less than kDistanceNotifyThresholdM // the notification will *not* append second distance, (like "In 500 meters. Turn left. Then. Turn right.") @@ -25,7 +25,7 @@ double constexpr kDistanceNotifyThresholdM = 50.0; // Returns true if the closest turn is an entrance to a roundabout and the second is // an exit form a roundabout. // Note. There are some cases when another turn (besides an exit from roundabout) -// follows an entrance to a roundabout. It could happend in case of turns inside a roundabout. +// follows an entrance to a roundabout. It could happened in case of turns inside a roundabout. // Returns false otherwise. bool IsClassicEntranceToRoundabout(routing::turns::TurnItemDist const & firstTurn, routing::turns::TurnItemDist const & secondTurn) @@ -244,13 +244,13 @@ void NotificationManager::SetLengthUnits(measurement_utils::Units units) switch (units) { case measurement_utils::Units::Metric: - m_settings.SetState(30 /* notificationTimeSeconds */, 200 /* minNotificationDistanceUnits */, + m_settings.SetState(30 /* notificationTimeSeconds */, 400 /* minNotificationDistanceUnits */, 2000 /* maxNotificationDistanceUnits */, GetSoundedDistMeters() /* soundedDistancesUnits */, measurement_utils::Units::Metric /* lengthUnits */); return; case measurement_utils::Units::Imperial: m_settings.SetState(30 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */, - 5000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */, + 1000 /* maxNotificationDistanceUnits */, GetSoundedDistFeet() /* soundedDistancesUnits */, measurement_utils::Units::Imperial /* lengthUnits */); return; } diff --git a/libs/routing/turns_sound_settings.hpp b/libs/routing/turns_sound_settings.hpp index 68dbd13ca..3914b2494 100644 --- a/libs/routing/turns_sound_settings.hpp +++ b/libs/routing/turns_sound_settings.hpp @@ -141,7 +141,7 @@ struct Notification uint32_t m_distanceUnits; uint8_t m_exitNum; /// if m_useThenInsteadOfDistance == true the m_distanceUnits is ignored. - /// The word "Then" shall be pronounced intead of the distance. + /// The word "Then" will be pronounced instead of the distance. bool m_useThenInsteadOfDistance; CarDirection m_turnDir = CarDirection::None; PedestrianDirection m_turnDirPedestrian = PedestrianDirection::None; diff --git a/libs/routing/turns_tts_text.cpp b/libs/routing/turns_tts_text.cpp index 32d93c10b..37883a014 100644 --- a/libs/routing/turns_tts_text.cpp +++ b/libs/routing/turns_tts_text.cpp @@ -92,8 +92,7 @@ void FormatFullRoadName(RouteSegment::RoadNameInfo & road, std::string & name) if (!road.m_name.empty()) outArr.emplace_back(road.m_name); } - - name = strings::JoinStrings(outArr.begin(), outArr.end(), "; "); + name = strings::JoinStrings(outArr.begin(), outArr.end(), ";"); strings::Trim(name); } @@ -133,7 +132,7 @@ std::string GetTtsText::GetTurnNotification(Notification const & notification) c if (notification.m_distanceUnits > 0) distStr = GetTextByIdTrimmed(GetDistanceTextId(notification)); - // Get a string like 245; CA 123; Highway 99; San Francisco + // Get a string like [245] > CA 123/Highway 99/San Francisco // In the future we could use the full RoadNameInfo struct to do some nice formatting. std::string streetOut; RouteSegment::RoadNameInfo nsi = notification.m_nextStreetInfo; // extract non-const @@ -344,6 +343,10 @@ std::string GetYouArriveTextId(Notification const & notification) return "you_have_reached_the_destination"; } +std::string GetContinueTextId(Notification const & notification){ + return "continue" +} + std::string GetDirectionTextId(Notification const & notification) { if (notification.IsPedestrianNotification())