13af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi/* 23af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * Copyright (C) 2010 The Android Open Source Project 33af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * 43af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * Licensed under the Apache License, Version 2.0 (the "License"); 53af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * you may not use this file except in compliance with the License. 63af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * You may obtain a copy of the License at 73af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * 83af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * http://www.apache.org/licenses/LICENSE-2.0 93af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * 103af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * Unless required by applicable law or agreed to in writing, software 113af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * distributed under the License is distributed on an "AS IS" BASIS, 123af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * See the License for the specific language governing permissions and 143af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi * limitations under the License. 153af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi */ 163af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi 173b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi/************************************************************************************************** 183b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi * AudioRecorder lifecycle 193b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi ****************************/ 203af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Triviextern SLresult android_audioRecorder_checkSourceSinkSupport(CAudioRecorder* ar); 213af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi 223af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Triviextern SLresult android_audioRecorder_create(CAudioRecorder* ar); 233af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi 2475e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi/* 2575e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * Return 2675e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_SUCCESS 2775e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_PARAMETER_INVALID 2875e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_INTERNAL_ERROR 2975e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_PRECONDITIONS_VIOLATED 3075e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi */ 31b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Triviextern SLresult android_audioRecorder_setConfig(CAudioRecorder* ar, const SLchar *configKey, 32b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi const void *pConfigValue, SLuint32 valueSize); 33b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 3475e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi/* 3575e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * if pConfigValue is NULL, pValueSize contains the size required for the given key 3675e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * 3775e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * Return 3875e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_SUCCESS 3975e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_PARAMETER_INVALID 4075e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_INTERNAL_ERROR 4175e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi * SL_RESULT_PRECONDITIONS_VIOLATED 4275e22870e41386cdc597bd29c76744d74d4c22adJean-Michel Trivi */ 43b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Triviextern SLresult android_audioRecorder_getConfig(CAudioRecorder* ar, const SLchar *configKey, 44b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi SLuint32* pValueSize, void *pConfigValue); 45b3e52a63baaea367cf411348b68ecd8fd429b029Jean-Michel Trivi 463af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Triviextern SLresult android_audioRecorder_realize(CAudioRecorder* ar, SLboolean async); 473af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi 483af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Triviextern void android_audioRecorder_destroy(CAudioRecorder* ar); 493af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Trivi 503b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi/************************************************************************************************** 513b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi * AudioRecorder control 523b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi ****************************/ 533b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi 543af2a8dd03f3113d5da1000dd79c143a9f0c4f36Jean-Michel Triviextern void android_audioRecorder_setRecordState(CAudioRecorder* ar, SLuint32 state); 553b142e50f4ae068f50f8e3d277e0f19910c67001Jean-Michel Trivi 56bcfe680db1e392f3bb29382c2e15e89c3af783edGlenn Kastenextern void android_audioRecorder_useRecordEventMask(CAudioRecorder *ar); 57b5ef0195d7b8fa1fceae5ef8a256ed19eb03cbedJean-Michel Trivi 58b5ef0195d7b8fa1fceae5ef8a256ed19eb03cbedJean-Michel Triviextern void android_audioRecorder_getPosition(CAudioRecorder *ar, SLmillisecond *pPosMsec); 59