rhdunn / espeak

eSpeak NG is an open source speech synthesizer that supports 101 languages and accents.
http://reecedunn.co.uk/espeak-for-android
GNU General Public License v3.0
386 stars 16 forks source link

sk and sl eSpeak voices are sometimes mixed on android #37

Closed pvagner closed 11 years ago

pvagner commented 11 years ago

I am running cm10 Android 4.1.1 on a Samsung galaxy S II GTI9100. Language in the android settings app is set to slovak. I am using talk back screen reader with this port of eSpeak compiled by my self. Therefore whenewer I navigate e.g. using the touch screen it naturally triggers the spoken output.

Steps to reproduce: 1) uninstall eSpeak if running an eyes-free port or any other... 2) Install this port, 3) run the eSpeak app and it will automatically install voice data. 4) enable talkback or any other screen reading application. On my system it immediatelly starts tallking using the default system voice chosen in the text to speech settings. 5) open system text to speech settings and make eSpeak the default. On my system the slovak voice is selected automatically. 6) play the testing text by tapping the button on the bottom of the text to speech settings window. You will hear eSpeak reading slovene (sl) text with slovak (sk) voice. 7) tap the settings button located to the right of the eSpeak icon in the text to speech settings window. The dialog pops up and eSpeak voice changes to sl. All spoken text is spoken with the sl voice from this point.

Once the language is chosen in the settings it then works consistently.

I dont know how to go about fixing it.

rhdunn commented 11 years ago

This has been reported to the eyes-free project as https://code.google.com/p/eyes-free/issues/detail?id=149.

While the comments in that defect point the issue at eSpeak's locale abbreviations differing from ISO 639-2, according to the IANA subtag registry and wikipedia, eSpeak is using the correct locale codes for Slovak and Slovenian.

However, while testing the accent character issue I have seen where pressing the "Listen to an example" UI element will use the English text instead of the Spanish (or whatever language is set). Pressing it again, you get the correct text.

This is in the GetSampleText class.

rhdunn commented 11 years ago

I understand what is going on here.

There are two ways that Android can specify a language (locale) -- the Java way and the standard way.

The locale passed to GetSampleText is slk for Slovak and slv for Slovenian; this is the Java way of specifying locales. This Java-style locale is passed to an Android Resources object which uses sk for Slovak and sl for Slovenian; this is the standard way of specifying these locales. The resource matching is apparently performing a "starts with" algorithm, so both Slovak and Slovenian get picked up as Slovenian.

NOTE: This means that other languages get the incorrect sample text. For example, Estonian ends up using Spanish!

I am in the process of adding test cases for this so I can fix the sample text selection.

rhdunn commented 11 years ago

I have now fixed the selection of the sample text. However, I am not sure that the language name is correct -- for Slovak it is using "slovenčina" and for Slovenian it is using "slovenščina". These look similar enough to me to think that it is saying "Slovenian" in both languages.

rhdunn commented 11 years ago

No, those translations are correct (at least according to Wikipedia). Therefore, I am closing this issue as fixed.

pvagner commented 11 years ago

Yes, the translations are definatelly corect according to what I know although I cant speak slovene (sl).

Thank you