mapbox-navigation-android icon indicating copy to clipboard operation
mapbox-navigation-android copied to clipboard

Speech synthesizer skips road names in non-Latin script embedded in Latin-script instruction

Open osamaashraf2005 opened this issue 4 years ago • 3 comments

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.

osamaashraf2005 avatar Feb 25 '20 06:02 osamaashraf2005

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?

Guardiola31337 avatar Jul 08 '20 13:07 Guardiola31337

@1ec5 ^^

abhishek1508 avatar Aug 04 '20 19:08 abhishek1508

Was Arabic recently supported by Polly?

Polly does support Arabic, but using the language code arb instead of the language code arthat 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

1ec5 avatar Aug 04 '20 19:08 1ec5