Stay organized with collections
Save and categorize content based on your preferences.
AudioSource
class 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
static val CAMCORDER: Int
Microphone audio source tuned for video recording, with the same orientation as the camera if available.
Value: 5
DEFAULT
static val DEFAULT: Int
Default audio source *
Value: 0
MIC
static val MIC: Int
Microphone audio source
Value: 1
UNPROCESSED
static val UNPROCESSED: Int
Microphone audio source tuned for unprocessed (raw) sound if available, behaves like DEFAULT
otherwise.
Value: 9
VOICE_CALL
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
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
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
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
static val VOICE_RECOGNITION: Int
Microphone audio source tuned for voice recognition.
Value: 6
VOICE_UPLINK
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
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaRecorder.AudioSource\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAudioSource\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaRecorder.AudioSource \"View this page in Java\") \n\n```\nclass AudioSource\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaRecorder.AudioSource](#) |\n\nDefines 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)](/reference/kotlin/android/media/MediaRecorder#setAudioSource(kotlin.Int)) or [AudioRecord.Builder.setAudioSource(int)](/reference/kotlin/android/media/AudioRecord.Builder#setAudioSource(kotlin.Int)).\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CAMCORDER](#CAMCORDER:kotlin.Int) Microphone audio source tuned for video recording, with the same orientation as the camera if available. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [DEFAULT](#DEFAULT:kotlin.Int) Default audio source \\* |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MIC](#MIC:kotlin.Int) Microphone audio source |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [REMOTE_SUBMIX](#REMOTE_SUBMIX:kotlin.Int) Audio source for a submix of audio streams to be presented remotely. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [UNPROCESSED](#UNPROCESSED:kotlin.Int) Microphone audio source tuned for unprocessed (raw) sound if available, behaves like [DEFAULT](#DEFAULT:kotlin.Int) otherwise. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_CALL](#VOICE_CALL:kotlin.Int) Voice call uplink + downlink audio source |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_COMMUNICATION](#VOICE_COMMUNICATION:kotlin.Int) Microphone audio source tuned for voice communications such as VoIP. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_DOWNLINK](#VOICE_DOWNLINK:kotlin.Int) Voice call downlink (Rx) audio source. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_PERFORMANCE](#VOICE_PERFORMANCE:kotlin.Int) Source for capturing audio meant to be processed in real time and played back for live performance (e.g karaoke). |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_RECOGNITION](#VOICE_RECOGNITION:kotlin.Int) Microphone audio source tuned for voice recognition. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [VOICE_UPLINK](#VOICE_UPLINK:kotlin.Int) Voice call uplink (Tx) audio source. |\n\nConstants\n---------\n\n### CAMCORDER\n\nAdded in [API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CAMCORDER: Int\n```\n\nMicrophone audio source tuned for video recording, with the same orientation as the camera if available. \n\n Value: 5\n\n### DEFAULT\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val DEFAULT: Int\n```\n\nDefault audio source \\* \n\n Value: 0\n\n### MIC\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MIC: Int\n```\n\nMicrophone audio source \n\n Value: 1\n\n### REMOTE_SUBMIX\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val REMOTE_SUBMIX: Int\n```\n\nAudio source for a submix of audio streams to be presented remotely.\n\nAn 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.\n\nCertain streams are excluded from the remote submix, including [AudioManager.STREAM_RING](/reference/kotlin/android/media/AudioManager#STREAM_RING:kotlin.Int), [AudioManager.STREAM_ALARM](/reference/kotlin/android/media/AudioManager#STREAM_ALARM:kotlin.Int), and [AudioManager.STREAM_NOTIFICATION](/reference/kotlin/android/media/AudioManager#STREAM_NOTIFICATION:kotlin.Int). These streams will continue to be presented locally as usual.\n\nCapturing the remote submix audio requires the [android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](../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.\n\nRequires [android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](../Manifest.permission.html#CAPTURE_AUDIO_OUTPUT:kotlin.String) \n\n Value: 8\n\n### UNPROCESSED\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val UNPROCESSED: Int\n```\n\nMicrophone audio source tuned for unprocessed (raw) sound if available, behaves like [DEFAULT](#DEFAULT:kotlin.Int) otherwise. \n\n Value: 9\n\n### VOICE_CALL\n\nAdded in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VOICE_CALL: Int\n```\n\nVoice call uplink + downlink audio source\n\nCapturing from `VOICE_CALL` source requires the [android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](../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. \n\n Value: 4\n\n### VOICE_COMMUNICATION\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VOICE_COMMUNICATION: Int\n```\n\nMicrophone audio source tuned for voice communications such as VoIP. It will for instance take advantage of echo cancellation or automatic gain control if available. \n\n Value: 7\n\n### VOICE_DOWNLINK\n\nAdded in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VOICE_DOWNLINK: Int\n```\n\nVoice call downlink (Rx) audio source.\n\nCapturing from `VOICE_DOWNLINK` source requires the [android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](../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. \n\n Value: 3\n\n### VOICE_PERFORMANCE\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VOICE_PERFORMANCE: Int\n```\n\nSource for capturing audio meant to be processed in real time and played back for live performance (e.g karaoke).\n\nThe capture path will minimize latency and coupling with playback path. \n\n Value: 10\n\n### VOICE_RECOGNITION\n\nAdded in [API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VOICE_RECOGNITION: Int\n```\n\nMicrophone audio source tuned for voice recognition. \n\n Value: 6\n\n### VOICE_UPLINK\n\nAdded in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VOICE_UPLINK: Int\n```\n\nVoice call uplink (Tx) audio source.\n\nCapturing from `VOICE_UPLINK` source requires the [android.Manifest.permission#CAPTURE_AUDIO_OUTPUT](../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. \n\n Value: 2"]]