1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16package ohos.hdi.audio.v1_0; 17 18import ohos.hdi.audio.v1_0.AudioTypes; 19import ohos.hdi.audio.v1_0.IAudioRender; 20import ohos.hdi.audio.v1_0.IAudioCapture; 21import ohos.hdi.audio.v1_0.IAudioCallback; 22 23interface IAudioAdapter { 24 InitAllPorts(); 25 CreateRender([in] struct AudioDeviceDescriptor desc, [in] struct AudioSampleAttributes attrs, [out] IAudioRender render); 26 DestroyRender([in] struct AudioDeviceDescriptor desc); 27 CreateCapture([in] struct AudioDeviceDescriptor desc, [in] struct AudioSampleAttributes attrs, [out] IAudioCapture capture); 28 DestroyCapture([in] struct AudioDeviceDescriptor desc); 29 GetPortCapability([in] struct AudioPort port, [out] struct AudioPortCapability capability); 30 SetPassthroughMode([in] struct AudioPort port, [in] enum AudioPortPassthroughMode mode); 31 GetPassthroughMode([in] struct AudioPort port, [out] enum AudioPortPassthroughMode mode); 32 GetDeviceStatus([out] struct AudioDeviceStatus status); 33 UpdateAudioRoute([in] struct AudioRoute route, [out] int routeHandle); 34 ReleaseAudioRoute([in] int routeHandle); 35 SetMicMute([in] boolean mute); 36 GetMicMute([out] boolean mute); 37 SetVoiceVolume([in] float volume); 38 SetExtraParams([in] enum AudioExtParamKey key, [in] String condition, [in] String value); 39 GetExtraParams([in] enum AudioExtParamKey key, [in] String condition, [out] String value); 40 RegExtraParamObserver([in] IAudioCallback audioCallback, [in] byte cookie); 41} 42