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

Commit 76b02e4e authored by Marc Wilson's avatar Marc Wilson Committed by Dirk Dougherty
Browse files

Update documentation for speech APIs.

Makes it clear that the intent and service APIs are likely to stream
audio over the network and notes that impact this has on bandwidth and
battery life.
Also clarifies that the service API should not be used for continuous
recognition as a result. The intent API only runs when the activity is
in the foreground so I didn't mention continuous recognition for it.

Bug: 10674392
Change-Id: Ib5e0c16b3124f4b7d892ef5bd4167f23662d2ca3
(cherry picked from commit 2921cee3)
parent 6f9e30e3
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -56,6 +56,9 @@ public class RecognizerIntent {
     * You must either use {@link Activity#startActivityForResult(Intent, int)}, or provide a
     * You must either use {@link Activity#startActivityForResult(Intent, int)}, or provide a
     * PendingIntent, to receive recognition results.
     * PendingIntent, to receive recognition results.
     *
     *
     * <p>The implementation of this API is likely to stream audio to remote servers to perform
     * speech recognition which can use a substantial amount of bandwidth.
     *
     * <p>Required extras:
     * <p>Required extras:
     * <ul>
     * <ul>
     *   <li>{@link #EXTRA_LANGUAGE_MODEL}
     *   <li>{@link #EXTRA_LANGUAGE_MODEL}
+8 −2
Original line number Original line Diff line number Diff line
@@ -39,8 +39,14 @@ import java.util.Queue;
 * This class provides access to the speech recognition service. This service allows access to the
 * This class provides access to the speech recognition service. This service allows access to the
 * speech recognizer. Do not instantiate this class directly, instead, call
 * speech recognizer. Do not instantiate this class directly, instead, call
 * {@link SpeechRecognizer#createSpeechRecognizer(Context)}. This class's methods must be
 * {@link SpeechRecognizer#createSpeechRecognizer(Context)}. This class's methods must be
 * invoked only from the main application thread. Please note that the application must have
 * invoked only from the main application thread. 
 * {@link android.Manifest.permission#RECORD_AUDIO} permission to use this class.
 *
 * <p>The implementation of this API is likely to stream audio to remote servers to perform speech
 * recognition. As such this API is not intended to be used for continuous recognition, which would
 * consume a significant amount of battery and bandwidth.
 *
 * <p>Please note that the application must have {@link android.Manifest.permission#RECORD_AUDIO}
 * permission to use this class.
 */
 */
public class SpeechRecognizer {
public class SpeechRecognizer {
    /** DEBUG value to enable verbose debug prints */
    /** DEBUG value to enable verbose debug prints */