• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 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 
17 package android.media;
18 
19 import android.media.MicrophoneInfoData;
20 
21 /**
22  * Native code must specify namespace media (media::IAudioRecord) when referring to this class.
23  *
24  * {@hide}
25  */
26 interface IAudioRecord {
27 
28   /* After it's created the track is not active. Call start() to
29    * make it active.
30    */
start(int event, int triggerSession)31   void start(int /*AudioSystem::sync_event_t*/ event,
32              int /*audio_session_t*/ triggerSession);
33 
34   /* Stop a track. If set, the callback will cease being called and
35    * obtainBuffer will return an error. Buffers that are already released
36    * will be processed, unless flush() is called.
37    */
stop()38   void stop();
39 
40   /* Get a list of current active microphones.
41    */
getActiveMicrophones(out MicrophoneInfoData[] activeMicrophones)42   void getActiveMicrophones(out MicrophoneInfoData[] activeMicrophones);
43 
44   /* Set the microphone direction (for processing).
45    */
setPreferredMicrophoneDirection(int direction)46   void setPreferredMicrophoneDirection(int /*audio_microphone_direction_t*/ direction);
47 
48   /* Set the microphone zoom (for processing).
49    */
setPreferredMicrophoneFieldDimension(float zoom)50   void setPreferredMicrophoneFieldDimension(float zoom);
51 
shareAudioHistory(@tf8InCpp String sharedAudioPackageName, long sharedAudioStartMs)52   void shareAudioHistory(@utf8InCpp String sharedAudioPackageName, long sharedAudioStartMs);
53 }
54