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.IAudioCallback; 20 21interface IAudioRender { 22 GetLatency([out] unsigned int ms); 23 RenderFrame([in] byte[] frame, [out] unsigned long replyBytes); 24 GetRenderPosition([out] unsigned long frames, [out] struct AudioTimeStamp time); 25 SetRenderSpeed([in] float speed); 26 GetRenderSpeed([out] float speed); 27 SetChannelMode([in] enum AudioChannelMode mode); 28 GetChannelMode([out] enum AudioChannelMode mode); 29 RegCallback([in] IAudioCallback audioCallback, [in] byte cookie); 30 DrainBuffer([out] enum AudioDrainNotifyType type); 31 IsSupportsDrain([out] boolean support); 32 CheckSceneCapability([in] struct AudioSceneDescriptor scene, [out] boolean supported); 33 SelectScene([in] struct AudioSceneDescriptor scene); 34 SetMute([in] boolean mute); 35 GetMute([out] boolean mute); 36 SetVolume([in] float volume); 37 GetVolume([out] float volume); 38 GetGainThreshold([out] float min, [out] float max); 39 GetGain([out] float gain); 40 SetGain([in] float gain); 41 GetFrameSize([out] unsigned long size); 42 GetFrameCount([out] unsigned long count); 43 SetSampleAttributes([in] struct AudioSampleAttributes attrs); 44 GetSampleAttributes([out] struct AudioSampleAttributes attrs); 45 GetCurrentChannelId([out] unsigned int channelId); 46 SetExtraParams([in] String keyValueList); 47 GetExtraParams([out] String keyValueList); 48 ReqMmapBuffer([in] int reqSize, [in] struct AudioMmapBufferDescripter desc); 49 GetMmapPosition([out] unsigned long frames, [out] struct AudioTimeStamp time); 50 AddAudioEffect([in] unsigned long effectid); 51 RemoveAudioEffect([in] unsigned long effectid); 52 GetFrameBufferSize([out] unsigned long bufferSize); 53 Start(); 54 Stop(); 55 Pause(); 56 Resume(); 57 Flush(); 58 TurnStandbyMode(); 59 AudioDevDump([in] int range, [in] int fd); 60 IsSupportsPauseAndResume([out] boolean supportPause, [out] boolean supportResume); 61} 62