You can use OpenSL ES to develop the audio recording function in OpenHarmony. Currently, only some
You can use OpenSL ES to develop the audio recording function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
[OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented yet is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
## How to Develop
## How to Develop
...
@@ -27,8 +24,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
...
@@ -27,8 +24,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface.
3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface.
```c++
```c++
...
@@ -36,8 +31,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
...
@@ -36,8 +31,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineItf);
result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineItf);
```
```
4. Configure the recorder information (including the input source **audiosource** and output source **audiosink**), and create a **pcmCapturerObject** instance.
4. Configure the recorder information (including the input source **audiosource** and output source **audiosink**), and create a **pcmCapturerObject** instance.
```c++
```c++
...
@@ -82,20 +75,18 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
...
@@ -82,20 +75,18 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform
5. Obtain the **recordItf** instance of the **SL_IID_RECORD** interface.
5. Obtain the **recordItf** instance of the **SL_IID_RECORD** interface.
You can use OpenSL ES to develop the audio playback function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
You can use OpenSL ES to develop the audio playback function in OpenHarmony. Currently, only some [OpenSL ES APIs](https://gitee.com/openharmony/third_party_opensles/blob/master/api/1.0.1/OpenSLES.h) are implemented. If an API that has not been implemented is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned.
## How to Develop
## How to Develop
To use OpenSL ES to develop the audio playback function in OpenHarmony, perform the following steps:
To use OpenSL ES to develop the audio playback function in OpenHarmony, perform the following steps:
...
@@ -20,8 +16,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
...
@@ -20,8 +16,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
#include <OpenSLES_Platform.h>
#include <OpenSLES_Platform.h>
```
```
2. Use the **slCreateEngine** API to obtain an **engine** instance.
2. Use the **slCreateEngine** API to obtain an **engine** instance.
```c++
```c++
...
@@ -30,8 +24,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
...
@@ -30,8 +24,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform