sles_definitions.h (5111B)
1 /* 2 * Copyright (C) 2010 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 /** 18 * This file is similar to the file "OpenSLES_AndroidConfiguration.h" found in 19 * the Android NDK, but removes the #ifdef __cplusplus defines, so we can keep 20 * using a C compiler in cubeb. 21 */ 22 23 #ifndef OPENSL_ES_ANDROIDCONFIGURATION_H_ 24 #define OPENSL_ES_ANDROIDCONFIGURATION_H_ 25 26 /*---------------------------------------------------------------------------*/ 27 /* Android AudioRecorder configuration */ 28 /*---------------------------------------------------------------------------*/ 29 30 /** Audio recording preset */ 31 /** Audio recording preset key */ 32 #define SL_ANDROID_KEY_RECORDING_PRESET \ 33 ((const SLchar *)"androidRecordingPreset") 34 /** Audio recording preset values */ 35 /** preset "none" cannot be set, it is used to indicate the current settings 36 * do not match any of the presets. */ 37 #define SL_ANDROID_RECORDING_PRESET_NONE ((SLuint32)0x00000000) 38 /** generic recording configuration on the platform */ 39 #define SL_ANDROID_RECORDING_PRESET_GENERIC ((SLuint32)0x00000001) 40 /** uses the microphone audio source with the same orientation as the camera 41 * if available, the main device microphone otherwise */ 42 #define SL_ANDROID_RECORDING_PRESET_CAMCORDER ((SLuint32)0x00000002) 43 /** uses the main microphone tuned for voice recognition */ 44 #define SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION ((SLuint32)0x00000003) 45 /** uses the main microphone tuned for audio communications */ 46 #define SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION ((SLuint32)0x00000004) 47 /** uses the main microphone unprocessed */ 48 #define SL_ANDROID_RECORDING_PRESET_UNPROCESSED ((SLuint32)0x00000005) 49 50 /*---------------------------------------------------------------------------*/ 51 /* Android AudioPlayer configuration */ 52 /*---------------------------------------------------------------------------*/ 53 54 /** Audio playback stream type */ 55 /** Audio playback stream type key */ 56 #define SL_ANDROID_KEY_STREAM_TYPE ((const SLchar *)"androidPlaybackStreamType") 57 58 /** Audio playback stream type values */ 59 /* same as android.media.AudioManager.STREAM_VOICE_CALL */ 60 #define SL_ANDROID_STREAM_VOICE ((SLint32)0x00000000) 61 /* same as android.media.AudioManager.STREAM_SYSTEM */ 62 #define SL_ANDROID_STREAM_SYSTEM ((SLint32)0x00000001) 63 /* same as android.media.AudioManager.STREAM_RING */ 64 #define SL_ANDROID_STREAM_RING ((SLint32)0x00000002) 65 /* same as android.media.AudioManager.STREAM_MUSIC */ 66 #define SL_ANDROID_STREAM_MEDIA ((SLint32)0x00000003) 67 /* same as android.media.AudioManager.STREAM_ALARM */ 68 #define SL_ANDROID_STREAM_ALARM ((SLint32)0x00000004) 69 /* same as android.media.AudioManager.STREAM_NOTIFICATION */ 70 #define SL_ANDROID_STREAM_NOTIFICATION ((SLint32)0x00000005) 71 72 /*---------------------------------------------------------------------------*/ 73 /* Android AudioPlayer and AudioRecorder configuration */ 74 /*---------------------------------------------------------------------------*/ 75 76 /** Audio Performance mode. 77 * Performance mode tells the framework how to configure the audio path 78 * for a player or recorder according to application performance and 79 * functional requirements. 80 * It affects the output or input latency based on acceptable tradeoffs on 81 * battery drain and use of pre or post processing effects. 82 * Performance mode should be set before realizing the object and should be 83 * read after realizing the object to check if the requested mode could be 84 * granted or not. 85 */ 86 /** Audio Performance mode key */ 87 #define SL_ANDROID_KEY_PERFORMANCE_MODE \ 88 ((const SLchar *)"androidPerformanceMode") 89 90 /** Audio performance values */ 91 /* No specific performance requirement. Allows HW and SW pre/post 92 * processing. */ 93 #define SL_ANDROID_PERFORMANCE_NONE ((SLuint32)0x00000000) 94 /* Priority given to latency. No HW or software pre/post processing. 95 * This is the default if no performance mode is specified. */ 96 #define SL_ANDROID_PERFORMANCE_LATENCY ((SLuint32)0x00000001) 97 /* Priority given to latency while still allowing HW pre and post 98 * processing. */ 99 #define SL_ANDROID_PERFORMANCE_LATENCY_EFFECTS ((SLuint32)0x00000002) 100 /* Priority given to power saving if latency is not a concern. 101 * Allows HW and SW pre/post processing. */ 102 #define SL_ANDROID_PERFORMANCE_POWER_SAVING ((SLuint32)0x00000003) 103 104 #endif /* OPENSL_ES_ANDROIDCONFIGURATION_H_ */