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

Commit 64dfb604 authored by Jeff Brown's avatar Jeff Brown
Browse files

Define AudioSource.REMOTE_SUBMIX.

Add an API to allow applications to record from the remote
submix when they have the required permissions.

Bug: 10265163
Change-Id: Id3815fe82a6713e058ce4b8ab6128a898481df7e
parent f15ef4b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12854,6 +12854,7 @@ package android.media {
    field public static final int CAMCORDER = 5; // 0x5
    field public static final int DEFAULT = 0; // 0x0
    field public static final int MIC = 1; // 0x1
    field public static final int REMOTE_SUBMIX = 8; // 0x8
    field public static final int VOICE_CALL = 4; // 0x4
    field public static final int VOICE_COMMUNICATION = 7; // 0x7
    field public static final int VOICE_DOWNLINK = 3; // 0x3
+22 −1
Original line number Diff line number Diff line
@@ -179,6 +179,27 @@ public class MediaRecorder
         *  is applied.
         */
        public static final int VOICE_COMMUNICATION = 7;

        /**
         * Audio source for a submix of audio streams to be presented remotely.
         * <p>
         * An application can use this audio source to capture a mix of audio streams
         * that should be transmitted to a remote receiver such as a Wifi display.
         * While recording is active, these audio streams are redirected to the remote
         * submix instead of being played on the device speaker or headset.
         * </p><p>
         * Certain streams are excluded from the remote submix, including
         * {@link AudioManager#STREAM_RING}, {@link AudioManager#STREAM_ALARM},
         * and {@link AudioManager#STREAM_NOTIFICATION}.  These streams will continue
         * to be presented locally as usual.
         * </p><p>
         * Capturing the remote submix audio requires the
         * {@link android.Manifest.permission#CAPTURE_AUDIO_OUTPUT} permission.
         * This permission is reserved for use by system components and is not available to
         * third-party applications.
         * </p>
         */
        public static final int REMOTE_SUBMIX = 8;
    }

    /**
@@ -294,7 +315,7 @@ public class MediaRecorder
     * @see android.media.MediaRecorder.AudioSource
     */
    public static final int getAudioSourceMax() {
        return AudioSource.VOICE_COMMUNICATION;
        return AudioSource.REMOTE_SUBMIX;
    }

    /**