Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f288a64f authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak Committed by Android (Google) Code Review
Browse files

Make TTS input string limit public and documented

Bug: 7456118
Change-Id: Iced44eb349e1abb551f991c2b9357a03bab3bb3d
parent 923584df
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -202,6 +202,12 @@ public class TextToSpeech {
         */
        public static final int USE_DEFAULTS = 0; // false

        /**
         * Limit of length of input string passed to speak/synthesizeToFile.
         * Larger strings will be rejected.
         */
        public static final int MAX_SPEECH_STRING_LENGTH = 4000;

        /**
         * Package name of the default TTS engine.
         *
@@ -801,7 +807,8 @@ public class TextToSpeech {
     * {@link #setOnUtteranceProgressListener}) and using the
     * {@link Engine#KEY_PARAM_UTTERANCE_ID} parameter.
     *
     * @param text The string of text to be spoken.
     * @param text The string of text to be spoken. No longer than
     *            {@link Engine#MAX_SPEECH_STRING_LENGTH} characters.
     * @param queueMode The queuing strategy to use, {@link #QUEUE_ADD} or {@link #QUEUE_FLUSH}.
     * @param params Parameters for the request. Can be null.
     *            Supported parameter names:
@@ -1113,7 +1120,8 @@ public class TextToSpeech {
     * {@link #setOnUtteranceProgressListener}) and using the
     * {@link Engine#KEY_PARAM_UTTERANCE_ID} parameter.
     *
     * @param text The text that should be synthesized
     * @param text The text that should be synthesized. No longer than
     *            {@link Engine#MAX_SPEECH_STRING_LENGTH} characters.
     * @param params Parameters for the request. Can be null.
     *            Supported parameter names:
     *            {@link Engine#KEY_PARAM_UTTERANCE_ID}.
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public abstract class TextToSpeechService extends Service {
    private static final boolean DBG = false;
    private static final String TAG = "TextToSpeechService";

    private static final int MAX_SPEECH_ITEM_CHAR_LENGTH = 4000;

    private static final String SYNTH_THREAD_NAME = "SynthThread";

    private SynthHandler mSynthHandler;
@@ -552,7 +552,7 @@ public abstract class TextToSpeechService extends Service {
                Log.e(TAG, "null synthesis text");
                return false;
            }
            if (mText.length() >= MAX_SPEECH_ITEM_CHAR_LENGTH) {
            if (mText.length() >= TextToSpeech.Engine.MAX_SPEECH_STRING_LENGTH) {
                Log.w(TAG, "Text too long: " + mText.length() + " chars");
                return false;
            }