From b54b0be375354d26b8e6d907a6fe5a4954f913b7 Mon Sep 17 00:00:00 2001 From: wusongqing Date: Tue, 12 Jul 2022 14:10:42 +0800 Subject: [PATCH] update docs against 5569 Signed-off-by: wusongqing --- en/application-dev/media/opensles-capture.md | 21 +++++-------------- en/application-dev/media/opensles-playback.md | 18 ---------------- en/application-dev/media/video-recorder.md | 2 -- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/en/application-dev/media/opensles-capture.md b/en/application-dev/media/opensles-capture.md index d7aab6606f..0d0946ca87 100644 --- a/en/application-dev/media/opensles-capture.md +++ b/en/application-dev/media/opensles-capture.md @@ -2,10 +2,7 @@ ## When to Use -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 yet is called, **SL_RESULT_FEATURE_UNSUPPORTED** will be returned. - - +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. ## How to Develop @@ -27,8 +24,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); ``` - - 3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface. ```c++ @@ -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); ``` - - 4. Configure the recorder information (including the input source **audiosource** and output source **audiosink**), and create a **pcmCapturerObject** instance. ```c++ @@ -81,21 +74,19 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform ``` 5. Obtain the **recordItf** instance of the **SL_IID_RECORD** interface. - - ``` + + ```c++ SLRecordItf recordItf; (*pcmCapturerObject)->GetInterface(pcmCapturerObject, SL_IID_RECORD, &recordItf); - ``` + ``` 6. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface. - ``` + ```c++ SLOHBufferQueueItf bufferQueueItf; (*pcmCapturerObject)->GetInterface(pcmCapturerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf); ``` - - 7. Register the **BufferQueueCallback** function. ```c++ @@ -120,7 +111,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform (*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_); ``` - 8. Start audio recording. ```c++ @@ -145,7 +135,6 @@ To use OpenSL ES to develop the audio recording function in OpenHarmony, perform } ``` - 9. Stop audio recording. ```c++ diff --git a/en/application-dev/media/opensles-playback.md b/en/application-dev/media/opensles-playback.md index f70dc251b8..661bf70ca1 100644 --- a/en/application-dev/media/opensles-playback.md +++ b/en/application-dev/media/opensles-playback.md @@ -1,13 +1,9 @@ # OpenSL ES Audio Playback Development - - ## When to Use 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 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 #include ``` - - 2. Use the **slCreateEngine** API to obtain an **engine** instance. ```c++ @@ -30,8 +24,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); ``` - - 3. Obtain the **engineEngine** instance of the **SL_IID_ENGINE** interface. ```c++ @@ -39,8 +31,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine); ``` - - 4. Configure the player and create an **AudioPlayer** instance. ```c++ @@ -66,8 +56,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform (*pcmPlayerObject)->Realize(pcmPlayerObject, SL_BOOLEAN_FALSE); ``` - - 5. Obtain the **bufferQueueItf** instance of the **SL_IID_OH_BUFFERQUEUE** interface. ``` @@ -75,8 +63,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform (*pcmPlayerObject)->GetInterface(pcmPlayerObject, SL_IID_OH_BUFFERQUEUE, &bufferQueueItf); ``` - - 6. Open an audio file and register the **BufferQueueCallback** function. ```c++ @@ -101,8 +87,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform (*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_); ``` - - 7. Obtain the **playItf** instance of the **SL_PLAYSTATE_PLAYING** interface and start playback. ```c++ @@ -111,8 +95,6 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform (*playItf)->SetPlayState(playItf, SL_PLAYSTATE_PLAYING); ``` - - 8. Stop audio playback. ```c++ diff --git a/en/application-dev/media/video-recorder.md b/en/application-dev/media/video-recorder.md index f77052fa5e..6d5b1f04da 100644 --- a/en/application-dev/media/video-recorder.md +++ b/en/application-dev/media/video-recorder.md @@ -8,8 +8,6 @@ During video recording, audio and video signals are captured, encoded, and saved ![en-us_image_video_recorder_state_machine](figures/en-us_image_video_recorder_state_machine.png) - - **Figure 2** Layer 0 diagram of video recording ![en-us_image_video_recorder_zero](figures/en-us_image_video_recorder_zero.png) -- GitLab