mapsme / omim

🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.55k stars 1.15k forks source link

TTS: upcoming turn with street name #929

Open warren-bank opened 8 years ago

warren-bank commented 8 years ago

Hi. Before all else, I just want to say how incredible this software project is!! I only just found it and began testing it a few days ago, which must have been immediately after the 5.2.1 release (android) that includes the new TTS (text-to-speech) feature. It being completely new, I'm sure there will be plenty of enhancements and feature requests. That is pretty much what this "issue" will be.. a feature request.. with a particular use-case in mind.

The TTS of upcoming turns works really really well. I used it along with the "routing" feature to drive through Las Vegas and I was amazed by how accurate the data was (thanks to the good people at OpenStreetMap) and how smoothly the application worked. In this particular use-case (ie: the way that I would typically use Google Maps), there are two "issues" (which I'll post separately for the sake of tracking)..

1 of 2) it would be really helpful if the TTS includes the street name of the upcoming turn

possibly there could be a preference to toggle this on/off.. such as a verbose setting.

I took a quick peek at the code.. grepping through it.. and the following seem to be relevant touch points:

https://github.com/mapsme/omim/blob/master/android/src/com/mapswithme/maps/sound/TtsPlayer.java https://github.com/mapsme/omim/blob/master/android/src/com/mapswithme/maps/Framework.java

private void speak(String textToSpeak)
public void playTurnNotifications()
public native static String[] nativeGenerateTurnNotifications()

https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/data_structures/turn_instructions.hpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/contractor/edge_based_graph_factory.cpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/contractor/edge_based_graph_factory.hpp

enum class TurnInstruction
struct TurnInstructionsClass
static inline TurnInstruction GetTurnDirectionOfInstruction(const double angle)
TurnInstruction EdgeBasedGraphFactory::AnalyzeTurn(const NodeID node_u,const NodeID node_v,const NodeID node_w,const double angle)

..so there's an android library (Framework) that calls native (c++) code ..nativeGenerateTurnNotifications returns an array of strings ..maybe if this returned an array of 2-element arrays? [ ["in 1000 feet turn left","onto Elm Street"], ["then immediately turn right","onto Main Street"] ] ..then the verbose setting would decide whether or not to concatenate the two strings together before passing the resulting string to speak

sorry.. I'm just spitballing.. thinking out loud.. you guys know the code WAYYYYYY better than I ever could.

in any case, GREAT GREAT GREAT work!!

therearesomewhocallmetim commented 8 years ago

Dear Warren,

The problem with street names begins when the names are not English. Many non-english tts-s mispronounce street names in their corresponding languages. We will think about adding this feature some time later.

Best regards, Timofey

On 11 Dec 2015, at 00:35, Warren Bank notifications@github.com wrote:

Hi. Before all else, I just want to say how incredible this software project is!! I only just found it and began testing it a few days ago, which must have been immediately after the 5.2 release (android) that includes the new TTS feature. It being completely new, I'm sure there will be plenty of enhancements and feature requests. That is pretty much what this "issue" will be.. a feature request.. with a particular use-case in mind.

The TTS of upcoming turns works really really well. I used it along with the "routing" feature to drive through Las Vegas and I was amazed by how accurate the data was (thanks to the good people at OpenStreetMap) and how smoothly the application worked. In this particular use-case (ie: the way that I would typically use Google Maps), there are two "issues" (which I'll post separately for the sake of tracking)..

1 of 2) it would be really helpful is the TTS included street names for upcoming turns

possibly there could be a preference to toggle this on/off.. such as a verbose setting.

I took a quick peek at the code.. grepping through it.. and the following seem to be relevant touch points:

https://github.com/mapsme/omim/blob/master/android/src/com/mapswithme/maps/sound/TtsPlayer.java https://github.com/mapsme/omim/blob/master/android/src/com/mapswithme/maps/sound/TtsPlayer.java https://github.com/mapsme/omim/blob/master/android/src/com/mapswithme/maps/Framework.java https://github.com/mapsme/omim/blob/master/android/src/com/mapswithme/maps/Framework.java private void speak(String textToSpeak) public void playTurnNotifications() public native static String[] nativeGenerateTurnNotifications() https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/data_structures/turn_instructions.hpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/data_structures/turn_instructions.hpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/contractor/edge_based_graph_factory.cpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/contractor/edge_based_graph_factory.cpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/contractor/edge_based_graph_factory.hpp https://github.com/mapsme/omim/blob/master/3party/osrm/osrm-backend/contractor/edge_based_graph_factory.hpp enum class TurnInstruction struct TurnInstructionsClass static inline TurnInstruction GetTurnDirectionOfInstruction(const double angle) TurnInstruction EdgeBasedGraphFactory::AnalyzeTurn(const NodeID node_u,const NodeID node_v,const NodeID node_w,const double angle) ..so there's an android library (Framework) that calls native (c++) code ..nativeGenerateTurnNotifications returns an array of strings ..maybe if this returned an array of 2-element arrays? [ ["turn left","onto Elm Street"], ["then turn immediately right","onto Main Street"] ] ..then the verbose setting would decide whether or not to concatenate the two strings together before passing the resulting string to speak

sorry.. I'm just spitballing.. thinking out loud.. you guys know the code WAYYYYYY better than I ever could.

in any case, GREAT GREAT GREAT work!!

— Reply to this email directly or view it on GitHub https://github.com/mapsme/omim/issues/929.

TimMagee commented 5 years ago

Its been a few years now. I know that this could be an issue in Non-English languages. Could I suggest that this feature be optional and off by default? Also I think that the fact that this feature could be less useful in non-English languages is not a good reason to not implement. Currently the feature doesn't exist at all. I currently do not use maps.me solely because it doesn't speak the names of the upcoming streets. It is such a useful feature to have.