提交 9d3de765 编写于 作者: J jiao_yanlin

Submission of interface development guidance document of audiostreammanager module

Signed-off-by: Njiao_yanlin <jiaoyanlin@huawei.com>
上级 a98f76b2
...@@ -57,7 +57,7 @@ audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => ...@@ -57,7 +57,7 @@ audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) =>
```js ```js
audioStreamManager.off('audioRendererChange'); audioStreamManager.off('audioRendererChange');
console.info('[RENDERER-CHANGE-ON-001] ######### RendererChange Off is called #########'); console.info('######### RendererChange Off is called #########');
``` ```
4. (可选)使用on('audioCapturerChange')监听音频捕获器更改事件。 4. (可选)使用on('audioCapturerChange')监听音频捕获器更改事件。
...@@ -66,7 +66,7 @@ console.info('[RENDERER-CHANGE-ON-001] ######### RendererChange Off is called ## ...@@ -66,7 +66,7 @@ console.info('[RENDERER-CHANGE-ON-001] ######### RendererChange Off is called ##
```js ```js
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(' ## CapChange on is called for element ' + i + ' ##'); console.info(' ## audioCapturerChange on is called for element ' + i + ' ##');
console.info('StreamId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); console.info('StreamId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info('ClientUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid); console.info('ClientUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info('Source for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source); console.info('Source for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
...@@ -90,7 +90,7 @@ audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => ...@@ -90,7 +90,7 @@ audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) =>
```js ```js
audioStreamManager.off('audioCapturerChange'); audioStreamManager.off('audioCapturerChange');
console.info('[GET_CAPTURER_STATE_2_PROMISE] ######### CapturerChange Off is called #########'); console.info('######### CapturerChange Off is called #########');
``` ```
6. (可选)使用getCurrentAudioRendererInfoArray()获取当前音频渲染器的信息。 6. (可选)使用getCurrentAudioRendererInfoArray()获取当前音频渲染器的信息。
...@@ -98,7 +98,7 @@ console.info('[GET_CAPTURER_STATE_2_PROMISE] ######### CapturerChange Off is cal ...@@ -98,7 +98,7 @@ console.info('[GET_CAPTURER_STATE_2_PROMISE] ######### CapturerChange Off is cal
```js ```js
await audioStreamManager.getCurrentAudioRendererInfoArray().then( function (AudioRendererChangeInfoArray) { await audioStreamManager.getCurrentAudioRendererInfoArray().then( function (AudioRendererChangeInfoArray) {
console.info('[GET_RENDERER_STATE_3_PROMISE] ######### Get Promise is called ##########'); console.info('######### Get Promise is called ##########');
if (AudioRendererChangeInfoArray != null) { if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
AudioRendererChangeInfo = AudioRendererChangeInfoArray[i]; AudioRendererChangeInfo = AudioRendererChangeInfoArray[i];
...@@ -131,7 +131,7 @@ await audioStreamManager.getCurrentAudioRendererInfoArray().then( function (Audi ...@@ -131,7 +131,7 @@ await audioStreamManager.getCurrentAudioRendererInfoArray().then( function (Audi
```js ```js
await audioStreamManager.getCurrentAudioCapturerInfoArray().then( function (AudioCapturerChangeInfoArray) { await audioStreamManager.getCurrentAudioCapturerInfoArray().then( function (AudioCapturerChangeInfoArray) {
console.info('AFCapturerChangeLog: [GET_CAP_STA_1_PR] **** Get Promise Called ****'); console.info('getCurrentAudioCapturerInfoArray: **** Get Promise Called ****');
if (AudioCapturerChangeInfoArray != null) { if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info('StreamId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId); console.info('StreamId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册