1/* 2 * Copyright (c) 2023 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.distributed_audio.audio.v1_0; 17 18import ohos.hdi.distributed_audio.audio.v1_0.AudioTypes; 19 20/** 21 * @brief Provides capabilities for audio capturing, including controlling the capturing, setting audio attributes, 22 * scenes, and volume, and capturing audio frames. 23 * @since 4.1 24 * @version 1.0 25 */ 26interface IAudioCapture { 27 CaptureFrame([out] byte[] frame, [out] unsigned long replyBytes); 28 GetCapturePosition([out] unsigned long frames, [out] struct AudioTimeStamp time); 29 CheckSceneCapability([in] struct AudioSceneDescriptor scene, [out] boolean supported); 30 SelectScene([in] struct AudioSceneDescriptor scene); 31 SetMute([in] boolean mute); 32 GetMute([out] boolean mute); 33 SetVolume([in] float volume); 34 GetVolume([out] float volume); 35 GetGainThreshold([out] float min, [out] float max); 36 GetGain([out] float gain); 37 SetGain([in] float gain); 38 GetFrameSize([out] unsigned long size); 39 GetFrameCount([out] unsigned long count); 40 SetSampleAttributes([in] struct AudioSampleAttributes attrs); 41 GetSampleAttributes([out] struct AudioSampleAttributes attrs); 42 GetCurrentChannelId([out] unsigned int channelId); 43 SetExtraParams([in] String keyValueList); 44 GetExtraParams([out] String keyValueList); 45 ReqMmapBuffer([in] int reqSize, [out] struct AudioMmapBufferDescriptor desc); 46 GetMmapPosition([out] unsigned long frames, [out] struct AudioTimeStamp time); 47 AddAudioEffect([in] unsigned long effectid); 48 RemoveAudioEffect([in] unsigned long effectid); 49 GetFrameBufferSize([out] unsigned long bufferSize); 50 Start(); 51 Stop(); 52 Pause(); 53 Resume(); 54 Flush(); 55 TurnStandbyMode(); 56 AudioDevDump([in] int range, [in] int fd); 57 IsSupportsPauseAndResume([out] boolean supportPause, [out] boolean supportResume); 58}