1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package android.media.audio.common; 17 18 /** 19 * Defines the audio source. An audio source defines both a default physical 20 * source of audio signal, and a recording configuration. This enum corresponds 21 * to MediaRecorder.AudioSource.* constants in the SDK. 22 * 23 * {@hide} 24 */ 25 @Backing(type="int") 26 @VintfStability 27 enum AudioSource { 28 /** 29 * Used as default value in parcelables to indicate that a value was not 30 * set. Should never be considered a valid setting, except for backward 31 * compatibility scenarios. 32 */ 33 SYS_RESERVED_INVALID = -1, 34 /** Default audio source. */ 35 DEFAULT = 0, 36 /** Microphone audio source. */ 37 MIC = 1, 38 /** Voice call uplink (Tx) audio source. */ 39 VOICE_UPLINK = 2, 40 /** Voice call downlink (Rx) audio source. */ 41 VOICE_DOWNLINK = 3, 42 /** Voice call uplink + downlink (duplex) audio source. */ 43 VOICE_CALL = 4, 44 /** 45 * Microphone audio source tuned for video recording, with the same 46 * orientation as the camera if available. 47 */ 48 CAMCORDER = 5, 49 /** Microphone audio source tuned for voice recognition. */ 50 VOICE_RECOGNITION = 6, 51 /** 52 * Microphone audio source tuned for voice communications such as VoIP. It 53 * will for instance take advantage of echo cancellation or automatic gain 54 * control if available. 55 */ 56 VOICE_COMMUNICATION = 7, 57 /** 58 * Audio source for a submix of audio streams to be presented remotely. An 59 * application can use this audio source to capture a mix of audio streams 60 * that should be transmitted to a remote receiver such as a Wifi display. 61 * While recording is active, these audio streams are redirected to the 62 * remote submix instead of being played on the device speaker or headset. 63 */ 64 REMOTE_SUBMIX = 8, 65 /** 66 * Microphone audio source tuned for unprocessed (raw) sound if available, 67 * behaves like DEFAULT otherwise. 68 */ 69 UNPROCESSED = 9, 70 /** 71 * Source for capturing audio meant to be processed in real time and played 72 * back for live performance (e.g karaoke). The capture path will minimize 73 * latency and coupling with playback path. 74 */ 75 VOICE_PERFORMANCE = 10, 76 /** 77 * Source for an echo canceller to capture the reference signal to be 78 * canceled. The echo reference signal will be captured as close as 79 * possible to the DAC in order to include all post processing applied to 80 * the playback path. 81 */ 82 ECHO_REFERENCE = 1997, 83 /** Audio source for capturing broadcast FM tuner output. */ 84 FM_TUNER = 1998, 85 /** 86 * A low-priority, preemptible audio source for for background software 87 * hotword detection. Same tuning as VOICE_RECOGNITION. 88 */ 89 HOTWORD = 1999, 90 /** Microphone audio source for ultrasound sound if available, 91 * behaves like DEFAULT otherwise. 92 */ 93 ULTRASOUND = 2000, 94 } 95