mapbox-navigation-android
mapbox-navigation-android copied to clipboard
Speech synthesizer skips road names in non-Latin script embedded in Latin-script instruction
I'm having the same problem in Android, I'm initializing the SpeechPlayerProvider like that: SpeechPlayerProvider speechPlayerProvider = new SpeechPlayerProvider(getContext(), "ar", true, voiceInstructionLoader); and not able to get the speech player speak the arabic road name. Can anyone help? what is the suitable way to let speech player speak road name in Arabic on Android.
Thanks for reaching out @osamaashraf2005
I've checked https://docs.aws.amazon.com/polly/latest/dg/SupportedLanguage.html and Arabic is on the list but not in our list of Supported languages
table https://github.com/mapbox/mapbox-navigation-android/blob/master/localization.md#supported-languages Was Arabic recently supported by Polly? Do you know @1ec5?
@1ec5 ^^
Was Arabic recently supported by Polly?
Polly does support Arabic, but using the language code arb
instead of the language code ar
that OSRM Text Instructions (and therefore the Directions API) use to represent Arabic. It’s essentially a mismatch between the language codes that are most appropriate for text versus speech synthesis. mapbox/locale-utils#9 tracks fixing the root issue, at which point we can enable built-in Arabic text-to-speech functionality without any developer intervention. Until then, we have to fall back to the system TTS engine or a third-party TTS engine.
To be clear, this is about reading the voice instructions entirely in Arabic. If you request instructions in English, for instance, but travel in an Arabic-speaking country, chances are you’ll hear something like “Turn left onto [pause] then turn right”. That pause is because Polly’s English voice is unable to make sense of the Arabic script. To address this issue, either the Directions API (and OSRM or Valhalla underneath it) would need to expose a localized name tag from OpenStreetMap like name:en
, or we would need to transliterate the road name to Latin on the client side. There is a system library on iOS for transliterating from Arabic to Latin, based on the ICU library, but I’m unsure if there’s a straightforward analogue on Android.
/ref Project-OSRM/osrm-backend#4561 valhalla/valhalla#2254