mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

"CT" Pronounced "Court" rather than "See Tee" #1577

Closed billyking991 closed 5 years ago

billyking991 commented 5 years ago

This isn't a huge deal, but I figured I would mention it because it's more of an annoyance. I live in Connecticut and the Android Navigation SDK pronounces CT (as in Connecticut) as "Court". This means all of the CT state roads are all Court 145, Court 156, etc. This isn't happening on iOS. Is there something that I need to do differently or is this something that can be fixed in the SDK? Again, not a huge deal, but it would be a nice change.

Android API: implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.23.0' and in earlier versions of the SDK.

Steps to trigger behavior

  1. Pick a route that uses Connecticut state roads.
  2. Drive on this roads using the navigation instructions.

Expected behavior

The navigation instructions should pronounce CT 145 as "See Tee One Forty Five".

Actual behavior

The navigation instructions pronounce CT 145 as "Court 145". This does not happen on iOS. Only on Android.

danesfeder commented 5 years ago

Hey @billyking991 👋 thanks for the report here. Do you have any idea what your device internet connectivity is when you're hearing this? Trying to debug this on our side. Thanks! We are going to reproduce and follow up here.

cc @kevinkreiser as a possible issue with instructions from native

billyking991 commented 5 years ago

I'm in a fairly populated area along 95 between New Haven and New London. It's a pretty good connection. I get this issue across all Android devices (Note 8, S7, Pixel). If you need any info from me, please don't hesitate to let me know. Like I said, it's not a huge issue, but I figured I would bring it up. Thanks for looking into this.

billyking991 commented 5 years ago

I just wanted to check in on this issue. It's still happening on my end and I just wanted to see if you need any other info from me. Again, not a huge deal, but I worry it will annoy users. Obviously, the abbreviation CT is for Court, but iOS doesn't act the same way (Or at a least I haven't been able to reproduce it on iOS. Thank you for your help in this matter!

danesfeder commented 5 years ago

Hey @billyking991 we use https://aws.amazon.com/polly/ paired with https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html to adjust the pronunciation and speed of our announcements.

If you need any info from me, please don't hesitate to let me know.

I think one thing we can do to debug this is take a look at your DirectionsRoute JSON. Can you provide that in this ticket so we can look at the announcements we are providing? DirectionsRoute#toJson().

Also can you provide the value of RouteProgress#voiceInstruction()? This will give us a better idea if the data you are getting is causing this pronunciation issue. Also please use 0.24.0 to test this - Thanks!

billyking991 commented 5 years ago

It doesn't look like I have either of those in my project. Do you have an example project that uses those so I can see what I'm doing wrong?

I'm overriding willVoice(SpeachAnnouncement announcement) like this to get the instructions:

@Override public String willVoice(SpeechAnnouncement announcement) {

    String text = announcement.announcement();
    text = replaceSpokenWordsText(text);

    return text;
}

Maybe it's something I'm doing wrong? Let me turn off all speech changes and see if it still happens. If you have an example project that I could look at that modifies the spoken instruction, it would be very helpful. Right now, I'm using a NavigationView with NavigationViewOptions to capture the speechAnnouncement using the speechAnnouncementListener. Might I be doing it wrong?

I started using the Android Nav SDK over the summer, so maybe there are changes I've missed as the library has been modified with each version.

Thank you for your help!!

billyking991 commented 5 years ago

I've updated to 0.24.1 and have begun testing. So far, I'm noticing that some of the streets that were pronounced "Court" are now pronounced using the correct CT abbreviation, which is great. Unfortunately, I'm still hearing "Court" in other CT roads.

I've checked OpenStreetMaps to see if there were discrepancies in how the roads were labeled on the map, but don't see anything out of the ordinary.

Here are some examples: CT 145 in Westbrook/Clinton CT are now pronounced correctly CT 80 in Killingworth CT is pronounced correctly. CT 81 in Clinton/Killingworth CT is pronounced "Court 81"

I will continue to check streets around my area. It looks like there have been some improvements in how the road names are pronounced in the latest nav SDK.

danesfeder commented 5 years ago

@billyking991 to confirm, you are seeing improvements but don't feel the pronunciations are completely fixed?

billyking991 commented 5 years ago

Not yet. It's weird. Sometimes, a road is pronounced correctly, and other times the same road is not pronounced correctly. I've been working on the app quite a bit and am working to try and figure out why it's happening...or at least what the pattern is. I really appreciate you checking in. I'm not super concerned with it, but it's a little confusing in Connecticut. I'd love to try and help you figure it out to try and make the app SDK better for everyone.

That said, I run BSNavigator and I mess with the phrases that are generated using the SpeechAnnouncementListener. Could it be something I'm doing? I will turn it off tomorrow on my drive to see if it's something I've created on my end. Here is my function:

@Override
public String willVoice(SpeechAnnouncement announcement) {

    String text = announcement.announcement();
    text = replaceSpokenWordsText(text);

    return text;
}

Could I be causing the problem?

danesfeder commented 5 years ago

@billyking991 oh yeah that may be it. Our NavigationSpeechPlayer uses https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html to provide better pronunciation.

So, if it doesn't break your code and you aren't stripping out the SSML tags in replaceSpokenWordsText, willVoice should look like:

@Override
public String willVoice(SpeechAnnouncement announcement) {

    String text = announcement.ssmlAnnouncement();
    text = replaceSpokenWordsText(text);

    return text;
}
danesfeder commented 5 years ago

Hey @billyking991 any updates here?

billyking991 commented 5 years ago

I apologize for the delay in answering. I just updated the function to use ssmlAnnouncement() instead of announcement() and now it speaks all of the amazon markup language along with the instructions. I believe that is why I used announcement() in the first place. Let me work on this to try and figure out what is going on.

danesfeder commented 5 years ago

Actually, this looks like a bug on our end - we are never setting the ssmlAnnouncement to be voiced. I opened #1675 to address this.

billyking991 commented 5 years ago

Thank you! I'll monitor #1675

billyking991 commented 5 years ago

This seems to be fixed on my end. Thank you!