Added in API level 1

AudioSource


class AudioSource
kotlin.Any
   ↳ android.media.MediaRecorder.AudioSource

Defines the audio source. An audio source defines both a default physical source of audio signal, and a recording configuration. These constants are for instance used in MediaRecorder.setAudioSource(int) or AudioRecord.Builder.setAudioSource(int).

Summary

Constants
static Int

Microphone audio source tuned for video recording, with the same orientation as the camera if available.

static Int

Default audio source *

static Int

Microphone audio source

static Int

Audio source for a submix of audio streams to be presented remotely.

static Int

Microphone audio source tuned for unprocessed (raw) sound if available, behaves like DEFAULT otherwise.

static Int

Voice call uplink + downlink audio source

static Int

Microphone audio source tuned for voice communications such as VoIP.

static Int

Voice call downlink (Rx) audio source.

static Int

Source for capturing audio meant to be processed in real time and played back for live performance (e.g karaoke).

static Int

Microphone audio source tuned for voice recognition.

static Int

Voice call uplink (Tx) audio source.

Constants

CAMCORDER

Added in API level 7
static val CAMCORDER: Int

Microphone audio source tuned for video recording, with the same orientation as the camera if available.

Value: 5

DEFAULT

Added in API level 1
static val DEFAULT: Int

Default audio source *

Value: 0

MIC

Added in API level 1
static val MIC: Int

Microphone audio source

Value: 1

REMOTE_SUBMIX

Added in API level 19
static val REMOTE_SUBMIX: Int

Audio source for a submix of audio streams to be presented remotely.

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.

Certain streams are excluded from the remote submix, including AudioManager.STREAM_RING, AudioManager.STREAM_ALARM, and AudioManager.STREAM_NOTIFICATION. These streams will continue to be presented locally as usual.

Capturing the remote submix audio requires the android.Manifest.permission#CAPTURE_AUDIO_OUTPUT permission. This permission is reserved for use by system components and is not available to third-party applications.


Requires android.Manifest.permission#CAPTURE_AUDIO_OUTPUT
Value: 8

UNPROCESSED

Added in API level 24
static val UNPROCESSED: Int

Microphone audio source tuned for unprocessed (raw) sound if available, behaves like DEFAULT otherwise.

Value: 9

VOICE_CALL

Added in API level 4
static val VOICE_CALL: Int

Voice call uplink + downlink audio source

Capturing from VOICE_CALL source requires the android.Manifest.permission#CAPTURE_AUDIO_OUTPUT permission. This permission is reserved for use by system components and is not available to third-party applications.

Value: 4

VOICE_COMMUNICATION

Added in API level 11
static val VOICE_COMMUNICATION: Int

Microphone audio source tuned for voice communications such as VoIP. It will for instance take advantage of echo cancellation or automatic gain control if available.

Value: 7
Added in API level 4
static val VOICE_DOWNLINK: Int

Voice call downlink (Rx) audio source.

Capturing from VOICE_DOWNLINK source requires the android.Manifest.permission#CAPTURE_AUDIO_OUTPUT permission. This permission is reserved for use by system components and is not available to third-party applications.

Value: 3

VOICE_PERFORMANCE

Added in API level 29
static val VOICE_PERFORMANCE: Int

Source for capturing audio meant to be processed in real time and played back for live performance (e.g karaoke).

The capture path will minimize latency and coupling with playback path.

Value: 10

VOICE_RECOGNITION

Added in API level 7
static val VOICE_RECOGNITION: Int

Microphone audio source tuned for voice recognition.

Value: 6
Added in API level 4
static val VOICE_UPLINK: Int

Voice call uplink (Tx) audio source.

Capturing from VOICE_UPLINK source requires the android.Manifest.permission#CAPTURE_AUDIO_OUTPUT permission. This permission is reserved for use by system components and is not available to third-party applications.

Value: 2