Commit Graph
51 Commits
Author SHA1 Message Date
Reece H. Dunn bb3b7e9a00 Use BCP 47 locale codes for Voice.getLocale() to support the correct localization on Lollipop and later. 2015-10-12 21:29:55 +01:00
Reece H. Dunn e08b1fc624 Update the copyright notices. 2015-10-12 07:24:20 +01:00
Reece H. Dunn c094f4840b Fix a Parcel collection == null exception.
This is caused by the Voice features being set to null. The fix in
Android Marshmallow is to make onGetFeaturesForLanguage return an
empty HashSet object. This does not work for eSpeak because:

  1.  eSpeak was overriding onGetVoices and initializing each Voice's
      features to null;

  2.  the bug is still present on Lollipop.

Thus, the fix here is two-fold:

  1.  make onGetVoices use onGetFeaturesForLanguage;

  2.  make onGetFeaturesForLanguage return an empty HashSet, so that
      eSpeak does not crash on Lollipop either.
2015-10-11 09:16:21 +01:00
Reece H. Dunn 7c8128cc12 Fix the tests on Android Marshmallow. 2015-10-10 22:14:17 +01:00
Reece H. Dunn 059f88138e TtsService: onSynthesizeText does not need to set the language (this is done by setLanguage/setVoice 2015-10-10 15:07:33 +01:00
Reece H. Dunn 385a18bf04 TtsService: clear mAvailableVoices before repopulating it 2015-10-10 14:49:28 +01:00
Reece H. Dunn ced5afb0a1 TtsService: only set mMatchingVoice when told to load the voice. 2015-10-10 14:46:07 +01:00
Reece H. Dunn 8f6f0966f6 Fix the TtsService.onGetDefaultVoiceNameFor behaviour. 2015-10-10 14:37:37 +01:00
Reece H. Dunn d6786a4df4 Factor out the onIsLanguageAvailable logic into a findVoice helper method. 2015-10-10 14:25:13 +01:00
Reece H. Dunn 0ac8564fe5 TextToSpeechServiceTest: add mMatchingVoice tests 2015-10-10 14:19:48 +01:00
Reece H. Dunn 1e16011ee8 Use onIsLanguageAvailable in onGetDefaultVoiceNameFor instead of onLoadLanguage (language does not need to be loaded at this point). 2015-10-10 10:15:07 +01:00
Reece H. Dunn 1f6d3eeb4b Make mAvailableVoices final to avoid a lint warning on synchronized calls. 2015-10-10 09:51:19 +01:00
Reece H. Dunn c4230b01ca Make Voice return the Java-based (ISO 639-3) language and country codes. 2015-10-09 06:55:52 +01:00
Reece H. Dunn 736986d609 TextToSpeechService: support SynthesisRequest.getVoiceName 2014-10-30 13:14:48 +00:00
Reece H. Dunn 1c0e4cfaa9 TextToSpeechService: use a HashMap for the voices.
This improves the performance of looking up a voice by name.
2014-10-30 12:56:06 +00:00
Reece H. Dunn cfb2f9d3cb Fix TextToSpeech,setLanguage on Android 5.0.
As of Android 5.0, TextToSpeech.setLanguage calls the new
TextToSpeechService.onGetDefaultVoiceNameFor(lang,country,variant)
and uses the specified voice name.

The default Android 5.0 implementation of onGetDefaultVoiceNameFor
does not work with eSpeak. This provides a working implementation.

This fixes the TextToSpeechTest.testLanguages tests on Android 5.0.
2014-10-30 12:28:32 +00:00
Reece H. Dunn c9003c50ba TextToSpeech: test and fix onIsValidVoiceName 2014-10-29 19:50:43 +00:00
Reece H. Dunn f9912e0c41 TtsService: fix and test onGetVoice.
The default Android 5.0 implementation enumerates the available
locales. This enumerates the voices returned by eSpeak.
2014-10-29 18:21:31 +00:00
Reece H. Dunn 7846e91089 TtsService: add wrappers for the new voice APIs.
This adds method declarations for the new voice APIs, forwarding
them to the default implementations.
2014-10-29 15:59:48 +00:00
Reece H. Dunn d90e58f9cd Fix deprecated SynthesisRequest.getText usage. 2014-10-29 15:34:20 +00:00
Reece H. Dunn 8f82baa646 Fix updating the number of installed voices after installing them within the activity. 2013-10-14 15:12:23 +01:00
Reece H. Dunn b3d5e46b83 Remove unused import statements. 2013-09-16 15:52:04 +01:00
Reece H. Dunn 602a14d76f TtsService.java: Use the locale from the SynthesisRequest, not the last onLoadLanguage call. 2013-09-07 14:45:27 +01:00
Reece H. Dunn 1de60cdc15 Rework the 'Punctuation level' (now 'Speak punctuation') preference to include a custom punctuation list. 2013-09-05 14:06:57 +01:00
Reece H. Dunn 622e6043ef Expose the Punctuation Level setting. 2013-09-04 20:23:25 +01:00
Reece H. Dunn 3cde1f7e6a TtsService.java: Make onSynthesizeText use VoiceSettings to get the voice parameters. 2013-09-04 17:59:56 +01:00
Reece H. Dunn 00bc5f2c6c VoiceVariant.java: Use MALE and FEMALE string constants. 2013-09-04 13:42:52 +01:00
Reece H. Dunn 65cf6c5aa1 Revert the updating of the language when the system language changes. 2013-05-09 16:19:06 +01:00
Reece H. Dunn fe4e139a83 TtsService: fix migrating the default_gender setting. 2013-05-09 15:24:57 +01:00
Reece H. Dunn cddd48e6f6 TtsService: support changing language to the user locale when they change the system language. 2013-05-09 14:54:09 +01:00
Reece H. Dunn 7ee59ed331 SpeechSynthesis: factor out the Voice class into its own file. 2013-05-09 13:56:02 +01:00
Reece H. Dunn 774c909a9c SpeechSynthesis: factor out the VoiceVariant class into its own file. 2013-05-09 13:51:12 +01:00
Reece H. Dunn 927a46d3cc TtsService: Rename mBroadcastReceiver to make its usage clear. 2013-05-09 12:07:21 +01:00
Reece H. Dunn 5ba4971d6b TtsService: fix a 'leaked receiver' exception. 2013-05-08 16:28:58 +01:00
Reece H. Dunn 894ac4fef2 TtsService: use the same default..max value clamp for speech rate as when upgrading the settings 2013-05-06 13:52:21 +01:00
Reece H. Dunn a42f748f2b Support voice variants and ages. 2013-05-05 13:25:46 +01:00
Reece H. Dunn 4b06b1b024 Support configuring the pitch range parameter. 2013-05-03 16:51:02 +01:00
Reece H. Dunn d0f5dc2ff4 Migrate the speech rate parameter to use the new SeekBar/Parameter UI. 2013-05-03 16:08:30 +01:00
Reece H. Dunn 09c79bb013 Make the rate setting use the new SeekBar/Parameter UI. 2013-05-03 13:07:54 +01:00
Reece H. Dunn ac6099ebf1 Hook up the volume parameter to a slider preference dialog. 2013-05-03 11:11:59 +01:00
Reece H. Dunn 233da111db TtsService.java: rework the logic to use the new Parameter API. 2013-05-02 20:33:43 +01:00
Reece H. Dunn cc72825682 SpeechSynthesis.java: expose the different voice options from eSpeak
This makes the following changes:

1.  setVoice takes a Voice object instead of a language string.

    This is to make the API cleaner and allows SpeechSynthesis
    to pass the correct parameter (identifier for SetVoiceByName,
    or name for SetVoiceByProperties) to espeak.

2.  The espeak_SetVoiceByName API is also exposed to support passing
    the voice variant to use.

3.  The age parameter has been re-added with the constants:
    *  SpeechSynthesis.AGE_ANY
    *  SpeechSynthesis.AGE_YOUNG
    *  SpeechSynthesis.AGE_OLD
    based on the behaviour of the eSpeak voice selection algorithm.

NOTE: Due to the way that voice selection is implemented in eSpeak,
if variant is specified, the age and gender cannot be specified and
vice versa.
2013-05-02 18:06:41 +01:00
Reece H. Dunn 88eab88d8a SpeechSynthesis.java: further simplify the setVoice method.
This renames `setVoiceByProperties` to the more consise `setVoice`
and removes the name parameter as this is not used -- the voice is
set by the language and gender parameters only.
2013-05-02 16:45:46 +01:00
Reece H. Dunn 027217d5f7 SpeechSynthesis.java: Simplify the SetVoiceByProperties parameters.
The `age` parameter is not useful as eSpeak does not use this when
selecting voices. This is always set to `0` by TtsService.java.

The `variant` parameter is not used to select the actual voice
variant (from the `!v` directory) but to select the n^th matching
voice from the list of matching voices. This is always set to
select the first matching voice by TtsService.java.
2013-05-02 16:32:46 +01:00
Reece H. Dunn 4d44e88dd2 TtsService: support detecting SSML documents 2013-03-14 16:53:22 +00:00
Reece H. Dunn 48fa803bc4 TtsService.java: ensure that the voice data is installed/upgraded correctly.
When using assistive technology like TalkBack and not accessing
either the eSpeak application or the Android TTS settings
directly, the voice data would previously not be installed/upgraded
correctly.

The approach here is to move the logic to onIsLanguageAvailable so
that if the espeak voice data is not installed or is upgradable
then trigger an install of the voice data and return
TextToSpeech.LANG_MISSING_DATA.
2013-02-12 12:21:34 +00:00
Reece H. Dunn 199029e97e TtsService.java: use the context from the TtsService object itself 2013-02-11 19:03:53 +00:00
Reece H. Dunn 9d0a23bb1c TtsService.java: also report TextToSpeech.LANG_MISSING_DATA if the base resources are not found or the data can be upgraded. 2013-02-11 01:00:06 +00:00
Reece H. Dunn 1e52512637 TtsService.java: report TextToSpeech.LANG_MISSING_DATA if the engine has not been initialized. 2013-02-11 00:49:10 +00:00
Reece H. Dunn 7816a0a204 TtsService: set the language properties to the matched voice, not the requested voice 2012-12-16 11:14:12 +00:00