summaryrefslogtreecommitdiffstats
path: root/core/java/android/speech/tts
Commit message (Collapse)AuthorAgeFilesLines
* NPE occured when trying to parcel voice features.Niels Egberts2015-08-051-1/+2
| | | | | | | The default features member should be an empty list instead of null. Bug: 22404239 Change-Id: Ia39982f17fd3b3cd0f3556435170aed2fac14fb8
* Fix crash with engines that don't override getVoices().Niels Egberts2015-06-262-3/+16
| | | | | | | | | | | The name of the voices was not normalized in getVoices(), therefore if you use getDefaultVoiceName, that name possibly doesn't appear in getVoices(). The framework would then run into a NullPointerException. This was caught by the cts tests. Also added a few more log statements. BUG: 22115315 Change-Id: I51404ddcd1bc10dd3e1ddaac410cfa9873bf1438
* Fixes for API Review: android.speech.ttsPrzemyslaw Szczepaniak2015-06-121-6/+6
| | | | | Bug: 21571893 Change-Id: Icd25f4aa9a465050c7410c7bfec004a71ba24548
* Don't strip country and variant from locale.Niels Egberts2015-05-071-29/+46
| | | | | | | | | | | | | | | | | | | | | When the synthesizer returns LANG_AVAILABLE or LANG_COUNTRY_AVAILABLE for a certain locale, we strip the country and variant from the locale before asking the synthesizer for the default voice name for this locale. This can prevent the synthesizer from picking the right locale. For instance it prevents the synthesizer from picking en-gb if en-au is requested, now it can only have a single preferred voice for all English countries. The solution is not to strip the country and variant from the locale. This is not likely to break anything, because the input to onGetDefaultVoiceNameFor was never expected to be a subset of all supported language-country-variant combinations. The default implementation handles this correctly. Change-Id: I017f69d321039c7aa7a3ef5a09ba138e35b66670 (cherry picked from commit 4758e99783493fc546e6819b5fe9d44e1ef8c318)
* Fix parens typos in documentation.Niels Egberts2015-04-101-3/+3
| | | | Change-Id: I4853ed72904985b1dab11f26cd6c5a332b884fc8
* Add resource type annotations to some APIsTor Norbye2015-03-131-1/+1
| | | | Change-Id: I37c8afdaea455aa92bc8270bb2dfd60616c5f9bc
* Remove unused imports in frameworks/base.John Spurlock2015-02-285-6/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Add @ResourceInt annotations on APIsTor Norbye2015-02-181-2/+3
| | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Add UtteranceProgressListener#onStop callbackPrzemyslaw Szczepaniak2014-12-094-14/+90
| | | | | | | | | | | | | | | New UtteranceProgressListener callback that allows to detect a call to TextToSpeech#stop() (or QUEUE_FLUSH usage) from the same client, or a QUEUE_DESTROY usage from any other client (Talkback uses it to preempt other users of TextToSpeech queue). This change is required for seamless Books read aloud feature+Talkback usage. + Fixes for broken tests/TtsTests Bug: 17901521 Change-Id: I30d2f297bb7c8d05cbeb16f63e85c1be0cca5c84
* Fix ambiguous TTS#playSilence method.Przemyslaw Szczepaniak2014-09-253-18/+18
| | | | | | | | | | | | | Due to recent fixes for TTS API review (b/17389935) overloaded playSilence method became ambiguous when the last argument is null. This change renames the new method to playSilentUtterance solving the issue. Also, since LMP API level is 21, I updated invalid references to it as API level 20 inside speech.tts. Bug: 17389935 Change-Id: I9f9fae988240d1cec45d44650e53ffc29803ccac
* Fix issues with new TTS APIPrzemyslaw Szczepaniak2014-09-223-18/+4
| | | | | Bug: 17389935 Change-Id: I59234b3222f59dc89be7e40f7d4706b1f8c610ce
* Replace TreeSet with HashSet.Przemyslaw Szczepaniak2014-09-111-5/+4
| | | | | | | Both Locale and Voice do not implement Comparable. Bug: 17467923 Change-Id: I683577e5b18ae1892e1ccea5ea241e1d016c9517
* API review requests for the TTS package.Przemyslaw Szczepaniak2014-09-083-33/+130
| | | | | | | | | | | | - New TextToSpeechService methods are no longer protected. - s/getRequiresNetworkConnection/isNetworkConnectionRequired - New TextToSpeec#play.. methods use a Bundle instead of a HashMap - New synthesizeToFile(), addSpeech(), addEarcon() methods take a File instead of a String with filepath. - TextToSpeechService#s/isValidVoiceName/onIsValidVoiceName Bug:17389935,17253934 Change-Id: Iec76f59015c34104683c050fe1ff1ceccd604134
* Set the TTS voice name for the default language.Przemyslaw Szczepaniak2014-08-051-0/+5
| | | | | | | | | | | | | | This changes makes the initial, default language set and the #setLanguage call with the default language as input exactly the same. Previously, the requests made after the initial default language set were missing the name of the default voice. + Some tests clean-up. Some of them fail due to issues with Locale#toLanguageTag upper-casing the variant field. Change-Id: I5470617007fe45462b7198bf62a03eb5fe47a590
* API for audio session ID generationJean-Michel Trivi2014-07-201-1/+1
| | | | | | | | | | | | Expose the value used by the framework to generate an audio session ID when a value isn't known. Rename allocateAudioSessionId() to generateAudioSessionId() as this operation doesn't "allocate" anything, and there is no allocated resource to free after this operation. Bug 16401631 Change-Id: I7a7bc05b39ea0b024ff225254eb755a9c85a2ad9
* Add AudioAttributes support in the TTS.Przemyslaw Szczepaniak2014-07-174-24/+81
| | | | | Bug: 16259299 Change-Id: I53f4f7a2b9a3b9a422affaf6abe4aca258e67d7f
* Fix TTS regression, TTS#stop can result in #onDone callback.Przemyslaw Szczepaniak2014-07-103-33/+4
| | | | | | | | | | | | Regressinon in the L, side effect of the rewrite. In pre-L android, UtteranceProgressListener#onDone was called (but only if client received UtteranceProgressListener#onStart for the utterance in progress) after client called TextToSpeech#stop. This changeset reinstates this behaviour. + Removed not used fallback callback Bug: 16149006 Change-Id: I2eb5ede0abe6f5717b07f09adad861465575c238
* Remove Markup and Utterance classes.Niels Egberts2014-07-082-1132/+0
| | | | | | | Markup is replaced by TtsSpan, and the Utterance class will be replaced by TtsSpanBuilder. Change-Id: I443786681f065ad8458fc05825de3ef182db8062
* Add support for voices in TTS API.Przemyslaw Szczepaniak2014-07-047-15/+903
| | | | | | | | Voices allow to expose multiple backends/voice packs for a single Locale. This is an attempt to port this feature from V2 API. Bug: 15834470 Change-Id: I0117de238cfcf028bcec5344b8d65c960b96b98c
* First argument of playSilence is incorrect in javaDoc.Niels Egberts2014-07-021-1/+1
| | | | Change-Id: Icc059471e61fb6154108b74ea45cb06554d80631
* Forgot to deprecate a method in current.txt before merging earlier change.Niels Egberts2014-07-021-5/+9
| | | | | | Also includes a comment fix and line size changes in TextToSpeech.java. Change-Id: Ia5842b694bca6cd9cae035164ffc605451e72d8b
* Support for CharSequences in the V1 API.Niels Egberts2014-07-024-45/+249
| | | | | | | | Two newly deprecated methods: - TextToSpeech.speak (over TextToSpeech.speak with mandatory utteranceId) - SynthesisRequest.getText (over SynthesisRequest.getCharSequenceText) Change-Id: I8a75ed335c91074c72d6ef374ff8b9c79a7c208d
* Add support for audio session id in the TTSPrzemyslaw Szczepaniak2014-07-026-68/+139
| | | | | | | + #playEarcon & #queueAudio respects request Volume/Pan settings. Bug:15432115 Change-Id: I136afef77afbc56c34810c64123f7be4b431d378
* Remove TextToSpeechClient API.Przemyslaw Szczepaniak2014-06-3023-2947/+109
| | | | | | | Removed all of TTS V2 api with exception of error codes. Bug: 15834470 Change-Id: I9d9d2aad01811af9b86bf7a3fd018a8d4e5c2f33
* Fix typo and broken sdk build.Przemyslaw Szczepaniak2014-06-131-1/+1
| | | | Change-Id: Icd1641955d1ca88396219db05312a4a9fd77ea80
* Merge "Expose "default tts locale" to the TTS V2 API."Przemyslaw Szczepaniak2014-06-115-105/+168
|\
| * Expose "default tts locale" to the TTS V2 API.Przemyslaw Szczepaniak2014-06-115-105/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows TTS V2 API client applications to honor the "default TTS locale" set by the user in the TTS settings. Note that the TTS V1 API uses 3 character country/language codes for locale encoding. It's the only system component that does that. TTS V2 uses the standard, valid Locale objects. The default TTS locale setting was stored as a 3 character locale string with "-" as the separator. This change switches the TTS locale setting format to the output of Locale.toString() call (on a valid Locale object). Methods used for reading this value can interpret both forms and try to return a valid Locale object as an output. Change-Id: Ice2e6c25a43eb9dd6e17d371ee582c2dae3329c9
* | Add missing copyright headers in speech.ttsPrzemyslaw Szczepaniak2014-06-124-0/+60
| | | | | | | | Change-Id: Icf1c3cf71ac45cb00606c8034af375e657c31ea5
* | Add missing #isSpeaking to TTS API V2Przemyslaw Szczepaniak2014-06-041-24/+65
|/ | | | | | | | TextToSpeech#isSpeaking queries TTS engine if it's currently outputting any audio, it was present in the TTS API V1. Change-Id: Iee4a91976b9b80653811fb458ac48d75418752cf
* Markup support for frameworkNiels Egberts2014-05-305-21/+1269
| | | | Change-Id: Ia5ad6cff7593c295944a90775a1b061c95f5cc3f
* TTS Connection callbacks are called on main thread.Przemyslaw Szczepaniak2014-05-162-3/+36
| | | | | | | | | | | | | After experimenting with the new TTS API I found out that receiving ConnectionCallbacks#onEngineStatusChange and #onServiceDisconnected callbacks on non-main thread are problematic. They are very rare and overhead of dealing with them in separate thread is high - in most cases user just wants to process those callbacks in the main thread context. This change should make new API usage easier. + Fixed default values of speech speed in voices from v1->v2 wrapper. Change-Id: I76d3b607b3b931b7eb10aa180775fd3607c43bd9
* Add (hidden) TTSEngines#isLocaleSetToDefaultForEngine method.Przemyslaw Szczepaniak2014-05-121-0/+18
| | | | | | | | TTSEngines#isLocaleSetToDefaultForEngine allows the Settings application to distinguish if the TTS engine locale is blank (set to follow the device locale) or if it's set to the same value as the device locale. Change-Id: I462584547d69c21cde4ac317c8a3b3bbc1680cae
* Add AudioFormat.getBytesPerSample and use itGlenn Kasten2014-05-062-14/+2
| | | | Change-Id: I90a40987ea99006af4a6e31136078c04976eb54d
* Remove "final" from TextToSpeechClient class.Przemyslaw Szczepaniak2014-04-101-2/+2
| | | | | | | | | It hinders attempts to mock the TextToSpeechClient class in tests. + javadoc typo fix Change-Id: I5b4590824d7e89b58451bdde457a627786333373
* Documentation update for TextToSpeech#getFeaturesPrzemyslaw Szczepaniak2014-03-241-0/+1
| | | | | | | Added note that it may return null in case of error. Bug: 12323454 Change-Id: I246f7e894c5e8a6421bdd72c7623c72e8a13fc3a
* Do not reset language in case of the TTS service reconnect.Przemyslaw Szczepaniak2014-03-211-4/+6
| | | | | Bug:12428804 Change-Id: I0b1b1274c47edd28eae1701808d50aeb6c36324c
* Add public SynthesisRequestV2 constructor.Przemyslaw Szczepaniak2014-01-301-0/+12
| | | | | | | | | While implementing the new TTS API, I found out that it's very difficult to create an SynthesisRequestV2 instance for testing purposes - it's a final class, with no publicly visible constructors. Bug: 8259486 Change-Id: I88b84fd8ad1ac6960f3932863ca758657f9547ff
* Allow clients to extend the TTS UtteranceId class.Przemyslaw Szczepaniak2014-01-301-22/+15
| | | | | | | | | | | | | | This change allows TTS clients to create (and use) classes derived from the UtteranceId class. This allows to attach a custom data and methods that can be reached later in callbacks that take the UtteranceId instance as parameter. Also, since we can't depend on the identityHashCode results being unique, this change adds AtomicInteger to generate unique identifiers for UtteranceId instances. Bug: 8259486 Change-Id: Id1e9eabc890ec585a7f8570fd20e287dcda9a11d
* Remove unused imports from frameworks/base.John Spurlock2013-11-202-5/+0
| | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* Fix Javadoc errorSiva Velusamy2013-10-291-2/+2
| | | | | | This fixes an error introduced with I180296d413a18301cead1c8e3212de2bd0c7e32d Change-Id: I06512a0fb388738fae5bba5540189095f23f1e2a
* TTS API: Replace "voice id" with "voice name"Przemyslaw Szczepaniak2013-10-296-57/+65
| | | | | | | | | | | "Voice id" and "voice name" are both used to reference a voice in a speech synthesis request. Voice id was a random integer, where voice name is human readable string, that provides more debug information and readability. Also, it's expected that voice name will stay consistent, and won't change during the life of the speech connection. Though, it may disappear. Change-Id: I180296d413a18301cead1c8e3212de2bd0c7e32d
* fix javadocs.Nick Kralevich2013-10-244-8/+8
| | | | Change-Id: Ie008e28db0d3de22c933b4ef1ccbd3f082010a77
* Add new TTS API.Przemyslaw Szczepaniak2013-10-2425-436/+3390
| | | | | | | | | | | | | | Much of existing API is reused (mostly on the service side). The new API provides better support for network-based synthesis, defines explicit synthesis fallback support, has better error handling, allows for multiple different voices per locale, features enumeration and custom extensions on a voice level and many more. If a service does not provide a V2 implementation, a basic adapter from V2 to existing V1 implementation is provided. Bug: 8259486 Change-Id: I797b7fc054f11c9b0d930f4dea582e57596ea127
* Catch MissingResourceException caused by bad locale in TTS.Przemyslaw Szczepaniak2013-09-252-20/+35
| | | | | | | | | | | | | Malformed locale objects will throw MissingResourceException from getISO3Country() and getISO3Language() methods. This change guard against the case where device default locale is malformed and user tries to get TTS default locale (b/10814409) and case where user tries to pass bad locale as argument to TextToSpeech.getFeatures method (b/10494193). Bug:10494193,10814409 Change-Id: Ie54d5d30bb042324da0c0d19b77c3a932c5642f7
* Fix SynthesisRequest javadocPrzemyslaw Szczepaniak2013-09-021-1/+1
| | | | | Bug: 10548784 Change-Id: I76a89bb9accdeee00c60a668adbdd789b995cd92
* Document the case where TTS onInit callback is called in ctor.Przemyslaw Szczepaniak2013-06-201-2/+4
| | | | | Bug: 8743649 Change-Id: Ibf6002f93af9d19d809679852310561e69d57c1e
* Allow TTS service to identify caller.Przemyslaw Szczepaniak2013-06-052-1/+18
| | | | | | | | | | | | | Added new field (+setter and getter) to SynthesisRequest with Uid of a calling process. TTS service will be able to discover packages names associated with caller using PackageManager.getPackagesForUid. This will allow to block buggy or poorly designed programs from an unintentional DDoS attacks against TTS service. Bug: 8625440 Change-Id: I5ac0ea191f952495c00301f17efdf28205353ae4
* Make TtsEngines.getDefaultLocale() method publicPrzemyslaw Szczepaniak2013-05-211-1/+12
| | | | | | | | | TtsEngines is hidden class, it's not a public API. It's required for tracking system language setting by TTS engines (Change: Ic4bde97ef7406adb64cc03efbe660275360ba3af ) Bug: 8613986 Change-Id: Iafafcdb244e1520893bee65febd5a137e3556317
* Fix for TTS.setLanguage throwing MissingResourceExceptionPrzemyslaw Szczepaniak2013-05-081-4/+34
| | | | | | | | | | | | Change I766f106b9165932de17de84bdd422d0fc0ae27f1 made getISO3* methods throw MissingResourceException if locale was invalid. This causes regression on last android release, where invalid locale was silently ignored. + fix for .isLanguageAvailable Bug: 8709594 Change-Id: Ieada6b90dc53cfdf0a4e2b4ca69854b811d0fec2
* Failing Text-To-Speech CTS tests fix.Przemyslaw Szczepaniak2013-03-131-1/+7
| | | | | | | | | Fix for failing android.speech.tts.cts.TextToSpeechServiceTest#testSynthesizeToFile. In test env, ParcelFileDescriptor instance may be EXACTLY the same one that client uses. And if it's closed by a client, then service is prevented from writing anything to the output. Bug: 8377754 Change-Id: I7f95aae1b877e543ab02d3c548b29537aa852a89