harmony 鸿蒙OpenSL ES

2023-06-24 浏览 (1023)

OpenSL ES

Introduction

Open Sound Library for Embedded Systems (OpenSL ES) is a set of audio acceleration standards for embedded systems. It provides objects and APIs for developers to implement high-performance, low-latency audio features. OpenHarmony implements some native APIs based on OpenSL ES 1.0.1 API specifications. The following table lists the related APIs.

Supported APIs

ObjectExternal InterfaceInterface InvocationSupportedDescription
SLEngineItfCreateAudioPlayerCreateAudioPlayer(SLEngineItf self, SLObjectItf *pPlayer, SLDataSource *pAudioSrc, SLDataSink *pAudioSnk, SLuint32 numInterfaces, const SLInterfaceID *pInterfaceIds, const SLboolean *pInterfaceRequired)YesCreates an audio player.
SLEngineItfCreateAudioRecorderreateAudioRecorder(SLEngineItf self, SLObjectItf *pRecorder, SLDataSource *pAudioSrc, SLDataSink *pAudioSnk, SLuint32 numInterfaces, const SLInterfaceID *pInterfaceIds, const SLboolean *pInterfaceRequired)YesCreates an audio recorder.
SLEngineItfCreateAudioOutputMixCreateOutputMix(SLEngineItf self, SLObjectItf *pMix, SLuint32 numInterfaces, const SLInterfaceID *pInterfaceIds, const SLboolean *pInterfaceRequired)YesCreates an audio output mixer.
SLObjectItfRealizeRealize(SLObjectItf self, SLboolean async)YesRealizes an audio player.
SLObjectItfgetStateGetState(SLObjectItf self, SLuint32 *state)YesObtains the state.
SLObjectItfgetInterfaceGetInterface(SLObjectItf self, const SLInterfaceID iid, void *interface)YesObtains the interface.
SLObjectItfDestroyDestroy(SLObjectItf self)YesDestroys an object.
SLOHBufferQueueItfEnqueueEnqueue(SLOHBufferQueueItf self, const void *buffer, SLuint32 size)YesAdds a buffer to the queue.
SLOHBufferQueueItfclearClear(SLOHBufferQueueItf self)YesReleases the buffer queue.
SLOHBufferQueueItfgetStateGetState(SLOHBufferQueueItf self, SLOHBufferQueueState *state)YesObtains the BufferQueue status.
SLOHBufferQueueItfgetBufferGetBuffer(SLOHBufferQueueItf self, SLuint8 **buffer, SLuint32 *size)YesObtains a buffer.
SLOHBufferQueueItfRegisterCallbackRegisterCallback(SLOHBufferQueueItf self, SlOHBufferQueueCallback callback, void *pContext)YesRegisters a callback.
SLPlayItfSetPlayStateSetPlayState(SLPlayItf self, SLuint32 state)YesSets the playback state.
SLPlayItfGetPlayStateGetPlayState(SLPlayItf self, SLuint32 *state)YesObtains the playback state.
SLRecordItfSetRecordStateSetRecordState(SLRecordItf self, SLuint32 state)YesSets the recording state.
SLRecordItfGetRecordStateGetRecordState(SLRecordItf self, SLuint32 *pState)YesObtains the recording state.
SLVolumeItfSetVolumeLevelSetVolumeLevel(SLVolumeItf self, SLmillibel *level)YesSets the volume.
SLVolumeItfGetVolumeLevelGetVolumeLevel(SLVolumeItf self, SLmillibel level)YesObtains the volume.
SLVolumeItfGetMaxVolumeLevelGetMaxVolumeLevel(SLVolumeItf self, SLmillibel *maxLevel)YesObtains the maximum volume.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙OpenHarmony Docker镜像

harmony 鸿蒙OpenHarmony Docker Image

harmony 鸿蒙Legal Notices

harmony 鸿蒙OpenHarmony Project

harmony 鸿蒙IDL Specifications and User Guide (for System Applications Only)

harmony 鸿蒙Application Development

harmony 鸿蒙OAID Service

harmony 鸿蒙AI

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/310fc530f02d4f85946cb838b168778d