Loading api/current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -17137,7 +17137,7 @@ package android.speech { package android.speech.tts { public abstract class SynthesisRequest { ctor public SynthesisRequest(java.lang.String); ctor public SynthesisRequest(java.lang.String, android.os.Bundle); method public abstract int audioAvailable(byte[], int, int); method public abstract int completeAudioAvailable(int, int, int, byte[], int, int); method public abstract int done(); Loading @@ -17145,6 +17145,7 @@ package android.speech.tts { method public java.lang.String getCountry(); method public java.lang.String getLanguage(); method public abstract int getMaxBufferSize(); method public android.os.Bundle getParams(); method public int getPitch(); method public int getSpeechRate(); method public java.lang.String getText(); core/java/android/speech/tts/FileSynthesisRequest.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.speech.tts; import android.media.AudioFormat; import android.os.Bundle; import android.util.Log; import java.io.File; Loading Loading @@ -47,8 +48,8 @@ class FileSynthesisRequest extends SynthesisRequest { private boolean mStopped = false; private boolean mDone = false; FileSynthesisRequest(String text, File fileName) { super(text); FileSynthesisRequest(String text, Bundle params, File fileName) { super(text, params); mFileName = fileName; } Loading core/java/android/speech/tts/PlaybackSynthesisRequest.java +4 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.speech.tts; import android.media.AudioFormat; import android.media.AudioTrack; import android.os.Bundle; import android.util.Log; /** Loading Loading @@ -52,8 +53,9 @@ class PlaybackSynthesisRequest extends SynthesisRequest { private boolean mStopped = false; private boolean mDone = false; PlaybackSynthesisRequest(String text, int streamType, float volume, float pan) { super(text); PlaybackSynthesisRequest(String text, Bundle params, int streamType, float volume, float pan) { super(text, params); mStreamType = streamType; mVolume = volume; mPan = pan; Loading core/java/android/speech/tts/SynthesisRequest.java +12 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package android.speech.tts; import android.os.Bundle; /** * A request for speech synthesis given to a TTS engine for processing. * Loading @@ -28,14 +30,16 @@ package android.speech.tts; public abstract class SynthesisRequest { private final String mText; private final Bundle mParams; private String mLanguage; private String mCountry; private String mVariant; private int mSpeechRate; private int mPitch; public SynthesisRequest(String text) { public SynthesisRequest(String text, Bundle params) { mText = text; mParams = new Bundle(params); } /** Loading Loading @@ -103,6 +107,13 @@ public abstract class SynthesisRequest { return mPitch; } /** * Gets the additional params, if any. */ public Bundle getParams() { return mParams; } /** * Gets the maximum number of bytes that the TTS engine can pass in a single call of * {@link #audioAvailable}. This does not apply to {@link #completeAudioAvailable}. Loading core/java/android/speech/tts/TextToSpeech.java +33 −2 Original line number Diff line number Diff line Loading @@ -424,6 +424,7 @@ public class TextToSpeech { private final Map<String, Uri> mEarcons; private final Map<String, Uri> mUtterances; private final Bundle mParams = new Bundle(); private String mCurrentEngine = null; /** * The constructor for the TextToSpeech class, using the default TTS engine. Loading Loading @@ -524,6 +525,7 @@ public class TextToSpeech { dispatchOnInit(ERROR); return false; } else { mCurrentEngine = engine; return true; } } Loading Loading @@ -685,6 +687,10 @@ public class TextToSpeech { * {@link Engine#KEY_PARAM_UTTERANCE_ID}, * {@link Engine#KEY_PARAM_VOLUME}, * {@link Engine#KEY_PARAM_PAN}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * * @return {@link #ERROR} or {@link #SUCCESS}. */ Loading Loading @@ -714,6 +720,10 @@ public class TextToSpeech { * Supported parameter names: * {@link Engine#KEY_PARAM_STREAM}, * {@link Engine#KEY_PARAM_UTTERANCE_ID}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * * @return {@link #ERROR} or {@link #SUCCESS}. */ Loading Loading @@ -741,6 +751,10 @@ public class TextToSpeech { * @param params Parameters for the request. Can be null. * Supported parameter names: * {@link Engine#KEY_PARAM_UTTERANCE_ID}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * * @return {@link #ERROR} or {@link #SUCCESS}. */ Loading Loading @@ -922,6 +936,10 @@ public class TextToSpeech { * @param params Parameters for the request. Can be null. * Supported parameter names: * {@link Engine#KEY_PARAM_UTTERANCE_ID}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * @param filename Absolute file filename to write the generated audio data to.It should be * something like "/sdcard/myappsounds/mysound.wav". * Loading @@ -945,6 +963,19 @@ public class TextToSpeech { copyStringParam(bundle, params, Engine.KEY_PARAM_UTTERANCE_ID); copyFloatParam(bundle, params, Engine.KEY_PARAM_VOLUME); copyFloatParam(bundle, params, Engine.KEY_PARAM_PAN); // Copy over all parameters that start with the name of the // engine that we are currently connected to. The engine is // free to interpret them as it chooses. if (!TextUtils.isEmpty(mCurrentEngine)) { for (Map.Entry<String, String> entry : params.entrySet()) { final String key = entry.getKey(); if (key != null && key.startsWith(mCurrentEngine)) { bundle.putString(key, entry.getValue()); } } } return bundle; } else { return mParams; Loading Loading
api/current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -17137,7 +17137,7 @@ package android.speech { package android.speech.tts { public abstract class SynthesisRequest { ctor public SynthesisRequest(java.lang.String); ctor public SynthesisRequest(java.lang.String, android.os.Bundle); method public abstract int audioAvailable(byte[], int, int); method public abstract int completeAudioAvailable(int, int, int, byte[], int, int); method public abstract int done(); Loading @@ -17145,6 +17145,7 @@ package android.speech.tts { method public java.lang.String getCountry(); method public java.lang.String getLanguage(); method public abstract int getMaxBufferSize(); method public android.os.Bundle getParams(); method public int getPitch(); method public int getSpeechRate(); method public java.lang.String getText();
core/java/android/speech/tts/FileSynthesisRequest.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.speech.tts; import android.media.AudioFormat; import android.os.Bundle; import android.util.Log; import java.io.File; Loading Loading @@ -47,8 +48,8 @@ class FileSynthesisRequest extends SynthesisRequest { private boolean mStopped = false; private boolean mDone = false; FileSynthesisRequest(String text, File fileName) { super(text); FileSynthesisRequest(String text, Bundle params, File fileName) { super(text, params); mFileName = fileName; } Loading
core/java/android/speech/tts/PlaybackSynthesisRequest.java +4 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.speech.tts; import android.media.AudioFormat; import android.media.AudioTrack; import android.os.Bundle; import android.util.Log; /** Loading Loading @@ -52,8 +53,9 @@ class PlaybackSynthesisRequest extends SynthesisRequest { private boolean mStopped = false; private boolean mDone = false; PlaybackSynthesisRequest(String text, int streamType, float volume, float pan) { super(text); PlaybackSynthesisRequest(String text, Bundle params, int streamType, float volume, float pan) { super(text, params); mStreamType = streamType; mVolume = volume; mPan = pan; Loading
core/java/android/speech/tts/SynthesisRequest.java +12 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package android.speech.tts; import android.os.Bundle; /** * A request for speech synthesis given to a TTS engine for processing. * Loading @@ -28,14 +30,16 @@ package android.speech.tts; public abstract class SynthesisRequest { private final String mText; private final Bundle mParams; private String mLanguage; private String mCountry; private String mVariant; private int mSpeechRate; private int mPitch; public SynthesisRequest(String text) { public SynthesisRequest(String text, Bundle params) { mText = text; mParams = new Bundle(params); } /** Loading Loading @@ -103,6 +107,13 @@ public abstract class SynthesisRequest { return mPitch; } /** * Gets the additional params, if any. */ public Bundle getParams() { return mParams; } /** * Gets the maximum number of bytes that the TTS engine can pass in a single call of * {@link #audioAvailable}. This does not apply to {@link #completeAudioAvailable}. Loading
core/java/android/speech/tts/TextToSpeech.java +33 −2 Original line number Diff line number Diff line Loading @@ -424,6 +424,7 @@ public class TextToSpeech { private final Map<String, Uri> mEarcons; private final Map<String, Uri> mUtterances; private final Bundle mParams = new Bundle(); private String mCurrentEngine = null; /** * The constructor for the TextToSpeech class, using the default TTS engine. Loading Loading @@ -524,6 +525,7 @@ public class TextToSpeech { dispatchOnInit(ERROR); return false; } else { mCurrentEngine = engine; return true; } } Loading Loading @@ -685,6 +687,10 @@ public class TextToSpeech { * {@link Engine#KEY_PARAM_UTTERANCE_ID}, * {@link Engine#KEY_PARAM_VOLUME}, * {@link Engine#KEY_PARAM_PAN}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * * @return {@link #ERROR} or {@link #SUCCESS}. */ Loading Loading @@ -714,6 +720,10 @@ public class TextToSpeech { * Supported parameter names: * {@link Engine#KEY_PARAM_STREAM}, * {@link Engine#KEY_PARAM_UTTERANCE_ID}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * * @return {@link #ERROR} or {@link #SUCCESS}. */ Loading Loading @@ -741,6 +751,10 @@ public class TextToSpeech { * @param params Parameters for the request. Can be null. * Supported parameter names: * {@link Engine#KEY_PARAM_UTTERANCE_ID}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * * @return {@link #ERROR} or {@link #SUCCESS}. */ Loading Loading @@ -922,6 +936,10 @@ public class TextToSpeech { * @param params Parameters for the request. Can be null. * Supported parameter names: * {@link Engine#KEY_PARAM_UTTERANCE_ID}. * Engine specific parameters may be passed in but the parameter keys * must be prefixed by the name of the engine they are intended for. For example * the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the * engine named "com.svox.pico" if it is being used. * @param filename Absolute file filename to write the generated audio data to.It should be * something like "/sdcard/myappsounds/mysound.wav". * Loading @@ -945,6 +963,19 @@ public class TextToSpeech { copyStringParam(bundle, params, Engine.KEY_PARAM_UTTERANCE_ID); copyFloatParam(bundle, params, Engine.KEY_PARAM_VOLUME); copyFloatParam(bundle, params, Engine.KEY_PARAM_PAN); // Copy over all parameters that start with the name of the // engine that we are currently connected to. The engine is // free to interpret them as it chooses. if (!TextUtils.isEmpty(mCurrentEngine)) { for (Map.Entry<String, String> entry : params.entrySet()) { final String key = entry.getKey(); if (key != null && key.startsWith(mCurrentEngine)) { bundle.putString(key, entry.getValue()); } } } return bundle; } else { return mParams; Loading