# MediaRecorder.AudioSource

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# AudioSource

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaRecorder.AudioSource "View this page in Java")  

```
class AudioSource
```

|---|------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                     ||
| ↳ | [android.media.MediaRecorder.AudioSource](https://developer.android.com/reference/kotlin/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)](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setAudioSource(kotlin.Int))or[AudioRecord.Builder.setAudioSource(int)](https://developer.android.com/reference/kotlin/android/media/AudioRecord.Builder#setAudioSource(kotlin.Int)).

## Summary

|                                                                                                                                                                                                             Constants                                                                                                                                                                                                             ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CAMCORDER](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#CAMCORDER:kotlin.Int) Microphone audio source tuned for video recording, with the same orientation as the camera if available.                                                                                                               |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [DEFAULT](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#DEFAULT:kotlin.Int) Default audio source \*                                                                                                                                                                                                    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MIC](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#MIC:kotlin.Int) Microphone audio source                                                                                                                                                                                                            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [REMOTE_SUBMIX](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#REMOTE_SUBMIX:kotlin.Int) Audio source for a submix of audio streams to be presented remotely.                                                                                                                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UNPROCESSED](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#UNPROCESSED:kotlin.Int) Microphone audio source tuned for unprocessed (raw) sound if available, behaves like[DEFAULT](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#DEFAULT:kotlin.Int)otherwise. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_CALL](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#VOICE_CALL:kotlin.Int) Voice call uplink + downlink audio source                                                                                                                                                                            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_COMMUNICATION](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#VOICE_COMMUNICATION:kotlin.Int) Microphone audio source tuned for voice communications such as VoIP.                                                                                                                               |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_DOWNLINK](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#VOICE_DOWNLINK:kotlin.Int) Voice call downlink (Rx) audio source.                                                                                                                                                                       |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_PERFORMANCE](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#VOICE_PERFORMANCE:kotlin.Int) Source for capturing audio meant to be processed in real time and played back for live performance (e.g karaoke).                                                                                      |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_RECOGNITION](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#VOICE_RECOGNITION:kotlin.Int) Microphone audio source tuned for voice recognition.                                                                                                                                                   |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_UPLINK](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#VOICE_UPLINK:kotlin.Int) Voice call uplink (Tx) audio source.                                                                                                                                                                             |

## Constants

### CAMCORDER

Added in[API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val DEFAULT: Int
```

Default audio source \*  

    Value: 0

### MIC

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MIC: Int
```

Microphone audio source  

    Value: 1

### REMOTE_SUBMIX

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://developer.android.com/reference/kotlin/android/media/AudioManager#STREAM_RING:kotlin.Int),[AudioManager.STREAM_ALARM](https://developer.android.com/reference/kotlin/android/media/AudioManager#STREAM_ALARM:kotlin.Int), and[AudioManager.STREAM_NOTIFICATION](https://developer.android.com/reference/kotlin/android/media/AudioManager#STREAM_NOTIFICATION:kotlin.Int). These streams will continue to be presented locally as usual.

Capturing the remote submix audio requires the[android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](https://developer.android.com/reference/kotlin/android/Manifest.permission.html#CAPTURE_AUDIO_OUTPUT:kotlin.String)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](https://developer.android.com/reference/kotlin/android/Manifest.permission.html#CAPTURE_AUDIO_OUTPUT:kotlin.String)  

    Value: 8

### UNPROCESSED

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val UNPROCESSED: Int
```

Microphone audio source tuned for unprocessed (raw) sound if available, behaves like[DEFAULT](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource#DEFAULT:kotlin.Int)otherwise.  

    Value: 9

### VOICE_CALL

Added in[API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val VOICE_CALL: Int
```

Voice call uplink + downlink audio source

Capturing from`VOICE_CALL`source requires the[android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](https://developer.android.com/reference/kotlin/android/Manifest.permission.html#CAPTURE_AUDIO_OUTPUT:kotlin.String)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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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

### VOICE_DOWNLINK

Added in[API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val VOICE_DOWNLINK: Int
```

Voice call downlink (Rx) audio source.

Capturing from`VOICE_DOWNLINK`source requires the[android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](https://developer.android.com/reference/kotlin/android/Manifest.permission.html#CAPTURE_AUDIO_OUTPUT:kotlin.String)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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val VOICE_RECOGNITION: Int
```

Microphone audio source tuned for voice recognition.  

    Value: 6

### VOICE_UPLINK

Added in[API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val VOICE_UPLINK: Int
```

Voice call uplink (Tx) audio source.

Capturing from`VOICE_UPLINK`source requires the[android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](https://developer.android.com/reference/kotlin/android/Manifest.permission.html#CAPTURE_AUDIO_OUTPUT:kotlin.String)permission. This permission is reserved for use by system components and is not available to third-party applications.  

    Value: 2