未验证 提交 268c5b6b 编写于 作者: O openharmony_ci 提交者: Gitee

!5831 audioXTS用例优化及失败用例适配

Merge pull request !5831 from liuxueqi/master
......@@ -17,7 +17,8 @@
{
"type": "ShellKit",
"run-command": [
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media"
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files",
"chmod 777 -R /data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry"
],
"cleanup-apps": true
},
......@@ -38,12 +39,8 @@
"./resource/audio/audioManager/StarWars10s-2C-16000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/",
"./resource/audio/audioManager/StarWars10s-2C-22050-2SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/",
"./resource/audio/audioManager/StarWars10s-2C-24000-3SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/",
"./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/",
"./resource/audio/audioManager/Believer.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media",
"./resource/audio/audioManager/file_example_WAV_1MG.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media",
"./resource/audio/audioManager/safe_and_sound_32.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media",
"./resource/audio/audioManager/test.mp3 ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media",
"./resource/audio/audioManager/test.mp4 ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/media"
"./resource/audio/audioManager/StarWars10s-2C-48000-4SW.wav ->/data/app/el2/100/base/ohos.acts.multimedia.audio.audiocapturer/haps/entry/files/"
]
}
]
......
......@@ -20,52 +20,52 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
describe('audioCapturerChange', function () {
let audioStreamManager;
let audioStreamManagerCB;
let Tag = "AFCapLog : ";
let Tag = "AFCapLog";
const audioManager = audio.getAudioManager();
console.info(Tag + 'Create AudioManger Object JS Framework');
console.info(`${Tag}: Create AudioManger Object JS Framework`);
beforeAll(async function () {
console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level');
console.info(`AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`);
let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionNameList = [permissionName1];
let appName = 'ohos.acts.multimedia.audio.audiocapturerchangeInfo';
await audioTestBase.applyPermission(appName, permissionNameList);
await sleep(100);
console.info('AudioFrameworkTest: beforeAll: END');
console.info(`AudioFrameworkTest: beforeAll: END`);
await sleep(100);
await audioManager.getStreamManager().then(async function (data) {
await audioManager.getStreamManager().then((data) => {
audioStreamManager = data;
console.info(Tag + ' Get AudioStream Manager : Success ');
console.info(`${Tag}: Get AudioStream Manager : Success `);
}).catch((err) => {
console.info(Tag + ' Get AudioStream Manager : ERROR : ' + err.message);
console.info(`${Tag}: Get AudioStream Manager : ERROR :${err.message}`);
});
audioManager.getStreamManager((err, data) => {
if (err) {
console.error(Tag + ' Get AudioStream Manager : ERROR : ' + err.message);
console.error(`${Tag}: Get AudioStream Manager : ERROR :${err.message}`);
}
else {
audioStreamManagerCB = data;
console.info(Tag + ' Get AudioStream Manager : Success ');
console.info(`${Tag}: Get AudioStream Manager : Success `);
}
});
await sleep(1000);
console.info(Tag + ' beforeAll: END');
console.info(`${Tag}: beforeAll: END`);
})
beforeEach(async function () {
console.info(Tag + ' beforeEach: Prerequisites at the test case level');
console.info(`${Tag}: beforeEach: Prerequisites at the test case level`);
await sleep(1000);
})
afterEach(function () {
console.info(Tag + ' afterEach: Test case-level clearance conditions');
console.info(`${Tag}: afterEach: Test case-level clearance conditions`);
})
afterAll(async function () {
await sleep(1000);
console.info(Tag + ' afterAll: Test suite-level cleanup condition');
console.info(`${Tag}: afterAll: Test suite-level cleanup condition`);
})
function sleep(ms) {
......@@ -101,22 +101,22 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', async (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag} : ## CapChange on is called for element ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioCapturerChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioCapturerChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioCapturerChangeInfoArray[i].capturerInfo.source}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags}`);
console.info(`${Tag} : Flag ${i} is: ${AudioCapturerChangeInfoArray[i].capturerState}`);;
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag} : Id: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 1 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
......@@ -166,52 +166,40 @@ describe('audioCapturerChange', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
audioStreamManagerCB.on('audioCapturerChange', async (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 2 && devDescriptor != null) {
resultFlag = true;
console.info(Tag + '[CAPTURER-CHANGE-ON-002] ResultFlag for element ' + i + ' is: ' + resultFlag);
console.info(`${Tag}: [CAPTURER-CHANGE-ON-002] ResultFlag for element ${i} is: ${resultFlag}`);
audioStreamManagerCB.off('audioCapturerChange');
console.info(Tag + '[CAPTURER-CHANGE-ON-002] ######### CapturerChange Off is called #########');
console.info(`${Tag}: [CAPTURER-CHANGE-ON-002] ######### CapturerChange Off is called #########`);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
done();
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
}
}
});
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
});
})
......@@ -246,65 +234,53 @@ describe('audioCapturerChange', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 3 && devDescriptor != null) {
resultFlag = true;
console.info(Tag + '[CAPTURER-CHANGE-ON-003] ResultFlag for element ' + i + ' is: ' + resultFlag);
console.info(`${Tag}: [CAPTURER-CHANGE-ON-003] ResultFlag for element ${i} is: ${resultFlag}`);
}
}
});
await sleep(100);
await audioCap.stop().then(async function () {
console.info(Tag + 'Capturer stopped : SUCCESS');
await audioCap.stop().then(() => {
console.info(`${Tag}: Capturer stopped : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer stop:ERROR : ' + err.message);
console.info(`${Tag}: Capturer stop:ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.off('audioCapturerChange');
await sleep(100);
console.info(Tag + '[CAPTURER-CHANGE-ON-003] ######### CapturerChange Off is called #########');
console.info(`${Tag}: [CAPTURER-CHANGE-ON-003] ######### CapturerChange Off is called #########`);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
expect(resultFlag).assertTrue();
......@@ -342,65 +318,53 @@ describe('audioCapturerChange', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
});
await audioCap.stop().then(async function () {
console.info(Tag + 'Capturer stopped : SUCCESS');
await audioCap.stop().then(() => {
console.info(`${Tag}: Capturer stopped : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer stop:ERROR : ' + err.message);
console.info(`${Tag}: Capturer stop:ERROR :${err.message}`);
});
await sleep(100);
audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 4 && devDescriptor != null) {
resultFlag = true;
console.info(Tag + '[CAPTURER-CHANGE-ON-004] ResultFlag for element ' + i + ' is: ' + resultFlag);
console.info(`${Tag}: [CAPTURER-CHANGE-ON-004] ResultFlag for element ${i} is: ${resultFlag}`);
}
}
});
await sleep(100);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
await sleep(100);
audioStreamManagerCB.off('audioCapturerChange');
await sleep(100);
console.info(Tag + '[CAPTURER-CHANGE-ON-004] ######### CapturerChange Off is called #########');
console.info(`${Tag}: [CAPTURER-CHANGE-ON-004] ######### CapturerChange Off is called #########`);
expect(resultFlag).assertTrue();
done();
......@@ -437,22 +401,10 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerInfo.source == 0 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
......@@ -503,49 +455,37 @@ describe('audioCapturerChange', function () {
audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerInfo.source == 7 && devDescriptor != null) {
resultFlag = true;
console.info(Tag + '[CAPTURER-CHANGE-ON-006] ResultFlag for element ' + i + ' is: ' + resultFlag);
console.info(`${Tag}: [CAPTURER-CHANGE-ON-006] ResultFlag for element ${i} is: ${resultFlag}`);
}
}
});
await sleep(100);
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await sleep(100);
audioStreamManagerCB.off('audioCapturerChange');
await sleep(100);
console.info(Tag + '[CAPTURER-CHANGE-ON-006] ######### CapturerChange Off is called #########');
console.info(`${Tag}: [CAPTURER-CHANGE-ON-006] ######### CapturerChange Off is called #########`);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
expect(resultFlag).assertTrue();
......@@ -581,22 +521,10 @@ describe('audioCapturerChange', function () {
}
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].streamId != undefined && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
......@@ -644,24 +572,12 @@ describe('audioCapturerChange', function () {
}
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let clientUid = AudioCapturerChangeInfoArray[i].clientUid;
let capFlags = AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags;
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (clientUid != undefined && capFlags == 0 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
......@@ -708,12 +624,7 @@ describe('audioCapturerChange', function () {
}
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -721,14 +632,7 @@ describe('audioCapturerChange', function () {
let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(Tag + 'Id:' + i + ':' + Id);
console.info(Tag + 'Type:' + i + ':' + dType);
console.info(Tag + 'Role:' + i + ':' + dRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + sRate);
console.info(Tag + 'CC:' + i + ':' + cCount);
console.info(Tag + 'CM:' + i + ':' + cMask);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) {
audioStreamManager.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -779,21 +683,9 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
audioStreamManager.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -850,21 +742,9 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
audioStreamManager.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -872,10 +752,10 @@ describe('audioCapturerChange', function () {
}
});
await sleep(100);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
})
......@@ -920,21 +800,9 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
audioStreamManager.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -943,10 +811,10 @@ describe('audioCapturerChange', function () {
});
await sleep(100);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
})
......@@ -991,21 +859,9 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
audioStreamManager.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -1014,10 +870,10 @@ describe('audioCapturerChange', function () {
});
await sleep(100);
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
})
......@@ -1051,12 +907,7 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -1064,14 +915,7 @@ describe('audioCapturerChange', function () {
let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(Tag + 'Id:' + i + ':' + Id);
console.info(Tag + 'Type:' + i + ':' + dType);
console.info(Tag + 'Role:' + i + ':' + dRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + sRate);
console.info(Tag + 'CC:' + i + ':' + cCount);
console.info(Tag + 'CM:' + i + ':' + cMask);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) {
audioStreamManager.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -1118,31 +962,19 @@ describe('audioCapturerChange', function () {
}
audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1150,28 +982,17 @@ describe('audioCapturerChange', function () {
await sleep(100);
await audioStreamManagerCB.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) {
console.info('AFCapturerChangeLog: [GET_CAP_STA_1_PR] **** Get Promise Called ****');
console.info(`AFCapturerChangeLog: [GET_CAP_STA_1_PR] **** Get Promise Called ****`);
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 1 && devDescriptor != null) {
audioStreamManagerCB.off('audioCapturerChange');
console.info('audioCapturerChange off success ');
console.info(`audioCapturerChange off Success `);
expect(true).assertTrue();
done();
}
......@@ -1183,10 +1004,10 @@ describe('audioCapturerChange', function () {
done();
});
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1220,41 +1041,30 @@ describe('audioCapturerChange', function () {
}
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1262,24 +1072,13 @@ describe('audioCapturerChange', function () {
await sleep(100);
await audioStreamManager.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) {
console.info(Tag + '[GET_CAPTURER_STATE_2_PROMISE] **** Get Promise Called ****');
console.info(`${Tag}: [GET_CAPTURER_STATE_2_PROMISE] **** Get Promise Called ****`);
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 2 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
......@@ -1294,10 +1093,10 @@ describe('audioCapturerChange', function () {
done();
});
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1332,71 +1131,49 @@ describe('audioCapturerChange', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.stop().then(async function () {
console.info(Tag + 'Capturer stopped : SUCCESS');
await audioCap.stop().then(() => {
console.info(`${Tag}: Capturer stopped : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer stop:ERROR : ' + err.message);
console.info(`${Tag}: Capturer stop:ERROR :${err.message}`);
});
await sleep(100);
await audioStreamManager.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) {
console.info(Tag + '[GET_CAPTURER_STATE_3_PROMISE] **** Get Promise Called ****');
console.info(`${Tag}: [GET_CAPTURER_STATE_3_PROMISE] **** Get Promise Called ****`);
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 3 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
......@@ -1411,10 +1188,10 @@ describe('audioCapturerChange', function () {
done();
});
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1450,44 +1227,29 @@ describe('audioCapturerChange', function () {
let resultFlag = false;
audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await sleep(100);
await audioStreamManagerCB.getCurrentAudioCapturerInfoArray().then(function (AudioCapturerChangeInfoArray) {
console.info('AFCapturerChangeLog: [GET_CAP_DD_PR] **** Get Promise Called ****');
console.info(`AFCapturerChangeLog: [GET_CAP_DD_PR] **** Get Promise Called ****`);
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -1495,14 +1257,7 @@ describe('audioCapturerChange', function () {
let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(Tag + 'Id:' + i + ':' + Id);
console.info(Tag + 'Type:' + i + ':' + dType);
console.info(Tag + 'Role:' + i + ':' + dRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + sRate);
console.info(Tag + 'CC:' + i + ':' + cCount);
console.info(Tag + 'CM:' + i + ':' + cMask);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) {
audioStreamManagerCB.off('audioCapturerChange');
expect(true).assertTrue();
......@@ -1512,14 +1267,14 @@ describe('audioCapturerChange', function () {
}
}
}).catch((err) => {
console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message);
console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`);
resultFlag = false;
});
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
});
expect(resultFlag).assertTrue();
......@@ -1556,68 +1311,46 @@ describe('audioCapturerChange', function () {
let resultFlag = false;
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => {
console.info(Tag + '[GET_CAPTURER_STATE_1_CALLBACK] **** Get Callback Called ****');
console.info(`${Tag}: [GET_CAPTURER_STATE_1_CALLBACK] **** Get Callback Called ****`);
await sleep(100);
if (err) {
console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message);
console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`);
resultFlag = false;
}
else {
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 1 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
done();
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1659,78 +1392,56 @@ describe('audioCapturerChange', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await sleep(100);
audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
});
await sleep(100);
audioStreamManagerCB.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => {
console.info(Tag + '[GET_CAPTURER_STATE_2_CALLBACK] **** Get Callback Called ****');
console.info(`${Tag}: [GET_CAPTURER_STATE_2_CALLBACK] **** Get Callback Called ****`);
await sleep(100);
if (err) {
console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message);
console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`);
resultFlag = false;
}
else {
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 2 && devDescriptor != null) {
audioStreamManagerCB.off('audioCapturerChange');
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
done();
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1772,85 +1483,63 @@ describe('audioCapturerChange', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
});
await audioCap.start().then(async function () {
console.info(Tag + 'Capturer started :SUCCESS ');
await audioCap.start().then(() => {
console.info(`${Tag}: Capturer started :Success `);
}).catch((err) => {
console.info(Tag + 'Capturer start :ERROR : ' + err.message);
console.info(`${Tag}: Capturer start :ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.stop().then(async function () {
console.info(Tag + 'Capturer stopped : SUCCESS');
await audioCap.stop().then(() => {
console.info(`${Tag}: Capturer stopped : SUCCESS`);
}).catch((err) => {
console.info(Tag + 'Capturer stop:ERROR : ' + err.message);
console.info(`${Tag}: Capturer stop:ERROR :${err.message}`);
});
await sleep(100);
audioStreamManager.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => {
console.info(Tag + '[GET_CAPTURER_STATE_3_CALLBACK] **** Get Callback Called ****');
console.info(`${Tag}: [GET_CAPTURER_STATE_3_CALLBACK] **** Get Callback Called ****`);
await sleep(100);
if (err) {
console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message);
console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`);
resultFlag = false;
}
else {
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
let devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioCapturerChangeInfoArray[i].capturerState == 3 && devDescriptor != null) {
audioStreamManager.off('audioCapturerChange');
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
done();
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1890,31 +1579,20 @@ describe('audioCapturerChange', function () {
audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + ' ## CapChange on is called for element ' + i + ' ##');
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: CapChange on is called for element ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(Tag + 'Id:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id);
console.info(Tag + 'Type:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType);
console.info(Tag + 'Role:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole);
console.info(Tag + 'Name:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + 'Addr:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]);
console.info(Tag + 'C' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]);
console.info(Tag + 'CM:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(Tag + 'AudioCapturer Created : Success : Stream Type: SUCCESS');
console.info(`${Tag}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(Tag + 'AudioCapturer Created : ERROR : ' + err.message);
console.info(`${Tag}: AudioCapturer Created : ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......@@ -1922,20 +1600,16 @@ describe('audioCapturerChange', function () {
await sleep(100);
audioStreamManager.getCurrentAudioCapturerInfoArray(async (err, AudioCapturerChangeInfoArray) => {
console.info(Tag + '[GET_CAPTURER_DD_CALLBACK] **** Get Callback Called ****');
console.info(`${Tag}: [GET_CAPTURER_DD_CALLBACK] **** Get Callback Called ****`);
await sleep(100);
if (err) {
console.log(Tag + 'getCurrentAudioCapturerInfoArray :ERROR: ' + err.message);
console.log(`${Tag}: getCurrentAudioCapturerInfoArray :ERROR:${err.message}`);
resultFlag = false;
}
else {
if (AudioCapturerChangeInfoArray != null) {
for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) {
console.info(Tag + 'StrId for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].streamId);
console.info(Tag + 'CUid for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].clientUid);
console.info(Tag + 'Src for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.source);
console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags);
console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState);
console.info(`${Tag}: ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i])}`);
for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -1943,21 +1617,14 @@ describe('audioCapturerChange', function () {
let sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(Tag + 'Id:' + i + ':' + Id);
console.info(Tag + 'Type:' + i + ':' + dType);
console.info(Tag + 'Role:' + i + ':' + dRole);
console.info(Tag + 'Nam:' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].name);
console.info(Tag + '' + i + ':' + AudioCapturerChangeInfoArray[i].deviceDescriptors[j].address);
console.info(Tag + 'SR:' + i + ':' + sRate);
console.info(Tag + 'CC:' + i + ':' + cCount);
console.info(Tag + 'CM:' + i + ':' + cMask);
console.info(`${Tag}:deviceDescriptors ${i} : ${JSON.stringify(AudioCapturerChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 15 && dRole == 1 && sRate != null && cCount != null && cMask != null) {
audioStreamManager.off('audioCapturerChange');
await audioCap.release().then(async function () {
console.info(Tag + 'Capturer release : SUCCESS');
await audioCap.release().then(function () {
console.info(`${Tag}: Capturer release : SUCCESS`);
done();
}).catch((err) => {
console.info(Tag + 'Capturer release :ERROR : ' + err.message);
console.info(`${Tag}: Capturer release :ERROR :${err.message}`);
expect(false).assertTrue();
done();
});
......
......@@ -17,7 +17,8 @@ import audio from '@ohos.multimedia.audio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('audioEventManagement', function () {
console.info('AudioFrameworkTest: Create AudioManger Object JS Framework');
let TagFrmwk = "AudioFrameworkTest";
console.info(`${TagFrmwk}: Create AudioManger Object JS Framework`);
let audioManager = null;
let deviceRoleValue = null;
let deviceTypeValue = null;
......@@ -27,10 +28,10 @@ describe('audioEventManagement', function () {
function getAudioManager() {
audioManager = audio.getAudioManager();
if (audioManager != null) {
console.info('AudioFrameworkTest: getAudioManger : PASS');
console.info(`${TagFrmwk}: getAudioManger : PASS`);
}
else {
console.info('AudioFrameworkTest: getAudioManger : FAIL');
console.info(`${TagFrmwk}: getAudioManger : FAIL`);
}
}
function displayDeviceProp(value, index, array) {
......@@ -65,29 +66,29 @@ describe('audioEventManagement', function () {
devTypeName = 'ERROR : UNKNOWN :' + value.deviceType;
}
console.info(`AudioFrameworkTest: device role: ${devRoleName}`);
console.info(`${TagFrmwk}: device role: ${devRoleName}`);
deviceRoleValue = value.deviceRole;
console.info(`AudioFrameworkTest: device type: ${devTypeName}`);
console.info(`${TagFrmwk}: device type: ${devTypeName}`);
deviceTypeValue = value.deviceType;
}
beforeAll(async function () {
console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level');
console.info(`${TagFrmwk}: beforeAll: Prerequisites at the test suite level`);
await getAudioManager();
})
beforeEach(function () {
console.info('AudioFrameworkTest: beforeEach: Prerequisites at the test case level');
console.info(`${TagFrmwk}: beforeEach: Prerequisites at the test case level`);
})
afterEach(async function () {
console.info('AudioFrameworkTest: afterEach: Test case-level clearance conditions');
console.info(`${TagFrmwk}: afterEach: Test case-level clearance conditions`);
await sleep(1000);
})
afterAll(async function () {
console.info('AudioFrameworkTest: afterAll: Test suite-level cleanup condition');
afterAll(function () {
console.info(`${TagFrmwk}: afterAll: Test suite-level cleanup condition`);
})
......@@ -103,14 +104,14 @@ describe('audioEventManagement', function () {
const PROMISE = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG)
PROMISE.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
});
......@@ -129,14 +130,14 @@ describe('audioEventManagement', function () {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_OUTPUT_ENUM_0100', 0, async function (done) {
const PROMISE = audioManager.getDevices(1)
PROMISE.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Promise: getDevices OUTPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Promise: getDevices : OUTPUT_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
});
......@@ -155,14 +156,14 @@ describe('audioEventManagement', function () {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INPUT_0100', 0, async function (done) {
const PROMISE = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG);
PROMISE.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
});
......@@ -181,15 +182,15 @@ describe('audioEventManagement', function () {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INTPUT_ENUM_0100', 0, async function (done) {
const PROMISE = audioManager.getDevices(2);
PROMISE.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Promise: getDevices INPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Promise: getDevices : INPUT_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
});
......@@ -208,15 +209,15 @@ describe('audioEventManagement', function () {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_0100', 0, async function (done) {
const PROMISE = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG);
PROMISE.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
});
......@@ -235,15 +236,15 @@ describe('audioEventManagement', function () {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_ENUM_0100', 0, async function (done) {
const PROMISE = audioManager.getDevices(3);
PROMISE.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
console.info(`${TagFrmwk}: Promise: getDevices ALL_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Promise: getDevices : ALL_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Promise: getDevices : ALL_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
});
......@@ -259,22 +260,22 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 0
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, function (done) {
audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`);
if (err) {
console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
console.error(`${TagFrmwk}: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
}
......@@ -290,22 +291,22 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, function (done) {
audioManager.getDevices(1, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`);
if (err) {
console.error(`AudioFrameworkTest: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
console.error(`${TagFrmwk}: Callback: OUTPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices OUTPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS');
console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL');
console.info(`${TagFrmwk}: Callback: getDevices : OUTPUT_DEVICES_FLAG : FAIL`);
expect(false).assertTrue();
}
}
......@@ -321,23 +322,23 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 0
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, function (done) {
audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`);
if (err) {
console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
console.error(`${TagFrmwk}: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`);
expect(false).assertTrue();
}
}
......@@ -353,23 +354,23 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 0
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, function (done) {
audioManager.getDevices(2, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`);
if (err) {
console.error(`AudioFrameworkTest: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
console.error(`${TagFrmwk}: Callback: INPUT_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices INPUT_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: PASS');
console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL');
console.info(`${TagFrmwk}: Callback: getDevices : INPUT_DEVICES_FLAG: FAIL`);
expect(false).assertTrue();
}
}
......@@ -385,22 +386,22 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 0
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, function (done) {
audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`);
if (err) {
console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`);
expect(false).assertTrue();
}
}
......@@ -416,22 +417,22 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, function (done) {
audioManager.getDevices(3, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`);
if (err) {
console.error(`AudioFrameworkTest: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
console.error(`${TagFrmwk}: Callback: ALL_DEVICES_FLAG: failed to get devices ${err.message}`);
expect().assertFail();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
console.info(`${TagFrmwk}: Callback: getDevices ALL_DEVICES_FLAG`);
value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: PASS');
console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: PASS`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Callback: getDevices : ALL_DEVICES_FLAG: FAIL');
console.info(`${TagFrmwk}: Callback: getDevices : ALL_DEVICES_FLAG: FAIL`);
expect(false).assertTrue();
}
}
......@@ -450,19 +451,19 @@ describe('audioEventManagement', function () {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_DEACTIVATE_0100', 2, async function (done) {
await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, false).then(function () {
// Setting device active ENUM 2 = SPEAKER
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate');
console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate`);
audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value) {
if (value == false) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error : ${err.message}`);
expect(false).assertTrue();
});
done();
......@@ -478,23 +479,23 @@ describe('audioEventManagement', function () {
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_DEACTIVATE_ENUM_0100', 2, async function (done) {
await audioManager.setDeviceActive(2, true).then(function () {
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Active');
console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Active`);
});
await audioManager.setDeviceActive(2, false).then(function () {
// Setting device active ENUM 2 = SPEAKER
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate');
console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Deactivate`);
audioManager.isDeviceActive(2).then(function (value) {
if (value == false) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error :' + err.message);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Deactivate : FAIL : Error : ${err.message}`);
expect(false).assertTrue();
});
done();
......@@ -510,19 +511,19 @@ describe('audioEventManagement', function () {
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_ACTIVATE_0100', 2, async function (done) {
await audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true).then(function () {
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate');
console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Activate`);
audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER).then(function (value) {
if (value == true) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL : ${value}`);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error : ${err.message}`);
expect(false).assertTrue();
});
done();
......@@ -538,19 +539,19 @@ describe('audioEventManagement', function () {
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_PR_ACTIVATE_ENUM_0100', 2, async function (done) {
await audioManager.setDeviceActive(2, true).then(function () {
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER: Activate');
console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER: Activate`);
audioManager.isDeviceActive(2).then(function (value) {
if (value == true) {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL : ${value}`);
expect(false).assertTrue();
}
});
}).catch((err) => {
console.info('AudioFrameworkTest: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error :' + err.message);
console.info(`${TagFrmwk}: Device Test: Promise : isDeviceActive : SPEAKER: Activate : FAIL :Error : ${err.message}`);
expect(false).assertTrue();
});
done();
......@@ -564,25 +565,25 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_DEACTIVATE_0100', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_DEACTIVATE_0100', 2, function (done) {
audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active');
console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`);
audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else if (value == false) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`);
expect(false).assertTrue();
}
done();
......@@ -602,26 +603,26 @@ describe('audioEventManagement', function () {
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_DEACTIVATE_ENUM_0100', 2, async function (done) {
await audioManager.setDeviceActive(2, true).then(function () {
console.info('AudioFrameworkTest: Device Test: Promise : setDeviceActive : SPEAKER : Active');
console.info(`${TagFrmwk}: Device Test: Promise : setDeviceActive : SPEAKER : Active`);
});
audioManager.setDeviceActive(2, false, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active');
console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`);
audioManager.isDeviceActive(2, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate: Error: ${err.message}`);
expect(false).assertTrue();
}
else if (value == false) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Deactivate : FAIL : ${value}`);
expect(false).assertTrue();
}
done();
......@@ -640,25 +641,25 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_0100', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_0100', 2, function (done) {
audioManager.setDeviceActive(audio.ActiveDeviceType.SPEAKER, true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active');
console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`);
audioManager.isDeviceActive(audio.ActiveDeviceType.SPEAKER, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else if (value == true) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL : ${value}`);
expect(false).assertTrue();
}
done();
......@@ -676,25 +677,25 @@ describe('audioEventManagement', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_ENUM_0100 ', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_SETDEVICEACTIVE_CB_ACTIVATE_ENUM_0100 ', 2, function (done) {
audioManager.setDeviceActive(2, true, (err) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : setDeviceActive : SPEAKER: Active');
console.info(`${TagFrmwk}: Device Test: Callback : setDeviceActive : SPEAKER: Active`);
audioManager.isDeviceActive(2, (err, value) => {
if (err) {
console.error(`AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`);
console.error(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active: Error: ${err.message}`);
expect(false).assertTrue();
}
else if (value == true) {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : PASS : ${value}`);
expect(true).assertTrue();
}
else {
console.info('AudioFrameworkTest: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL :' + value);
console.info(`${TagFrmwk}: Device Test: Callback : isDeviceActive : SPEAKER: Active : FAIL : ${value}`);
expect(false).assertTrue();
}
done();
......
......@@ -20,43 +20,43 @@ describe('audioRendererChange', function () {
let audioStreamManager;
let audioStreamManagerCB;
let Tag = 'AFRenLog : ';
let Tag = 'AFRenLog';
const AUDIOMANAGER = audio.getAudioManager();
console.info(`${Tag} : 'Create AudioManger Object JS Framework`);
console.info(`${Tag} : Create AudioManger Object JS Framework`);
beforeAll(async function () {
await AUDIOMANAGER.getStreamManager().then(async function (data) {
await AUDIOMANAGER.getStreamManager().then(function (data) {
audioStreamManager = data;
console.info(`${Tag} : 'Get AudioStream Manager : Success `);
console.info(`${Tag} : Get AudioStream Manager : Success `);
}).catch((err) => {
console.info(`${Tag} : 'Get AudioStream Manager : ERROR : ${err.message}`);
console.info(`${Tag} : Get AudioStream Manager : ERROR : ${err.message}`);
});
AUDIOMANAGER.getStreamManager((err, data) => {
if (err) {
console.error(`${Tag} : 'Get AudioStream Manager : ERROR : ${err.message}`);
console.error(`${Tag} : Get AudioStream Manager : ERROR : ${err.message}`);
}
else {
audioStreamManagerCB = data;
console.info(`${Tag} : 'Get AudioStream Manager : Success `);
console.info(`${Tag} : Get AudioStream Manager : Success `);
}
});
await sleep(1000);
console.info(`${Tag} : 'beforeAll: Prerequisites at the test suite level`);
console.info(`${Tag} : beforeAll: Prerequisites at the test suite level`);
})
beforeEach(async function () {
console.info(`${Tag} : 'beforeEach: Prerequisites at the test case level`);
console.info(`${Tag} : beforeEach: Prerequisites at the test case level`);
await sleep(1000);
})
afterEach(function () {
console.info(`${Tag} : 'afterEach: Test case-level clearance conditions`);
console.info(`${Tag} : afterEach: Test case-level clearance conditions`);
})
afterAll(async function () {
console.info(`${Tag} : 'afterAll: Test suite-level cleanup condition`);
afterAll(function () {
console.info(`${Tag} : afterAll: Test suite-level cleanup condition`);
})
function sleep(ms) {
......@@ -121,7 +121,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -134,7 +134,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-001] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -176,7 +176,7 @@ describe('audioRendererChange', function () {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -187,23 +187,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 2 && devDescriptor != null) {
resultFlag = true;
......@@ -214,7 +201,7 @@ describe('audioRendererChange', function () {
await sleep(100);
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS `);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -227,16 +214,16 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-ON-002] ######### RendererChange Off is called #########`);
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : 'Renderer release :ERROR : ${err.message}`);
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
});
expect(resultFlag).assertTrue();
done();
......@@ -274,14 +261,14 @@ describe('audioRendererChange', function () {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS `);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -291,23 +278,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 3 && devDescriptor != null) {
resultFlag = true;
......@@ -318,7 +292,7 @@ describe('audioRendererChange', function () {
await sleep(100);
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
......@@ -330,7 +304,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-003] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -372,20 +346,20 @@ describe('audioRendererChange', function () {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS }`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
});
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS}`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
......@@ -396,22 +370,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##}`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 4 && devDescriptor != null) {
resultFlag = true;
......@@ -422,7 +384,7 @@ describe('audioRendererChange', function () {
await sleep(100);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -469,14 +431,14 @@ describe('audioRendererChange', function () {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -487,22 +449,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##}`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 5 && devDescriptor != null) {
resultFlag = true;
......@@ -513,7 +463,7 @@ describe('audioRendererChange', function () {
await sleep(100);
await audioRen.pause().then(async function () {
await audioRen.pause().then(function () {
console.info(`${Tag} : renderInstant Pause :SUCCESS `);
}).catch((err) => {
console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`);
......@@ -525,13 +475,13 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-005] ######### RendererChange Off is called #########`);
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -573,23 +523,10 @@ describe('audioRendererChange', function () {
audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.content == 5 && devDescriptor != null) {
resultFlag = true;
......@@ -599,7 +536,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -611,7 +548,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-006] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -654,23 +591,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.content == 0 && devDescriptor != null) {
resultFlag = true;
......@@ -680,7 +604,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -692,7 +616,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-007] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -735,23 +659,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.content == 1 && devDescriptor != null) {
resultFlag = true;
......@@ -761,7 +672,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -773,7 +684,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-008] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -816,23 +727,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.content == 2 && devDescriptor != null) {
resultFlag = true;
......@@ -842,7 +740,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -854,7 +752,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-009] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -897,23 +795,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.content == 3 && devDescriptor != null) {
resultFlag = true;
......@@ -923,7 +808,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -936,7 +821,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-010] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -979,23 +864,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.content == 4 && devDescriptor != null) {
resultFlag = true;
......@@ -1005,7 +877,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1018,7 +890,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-011] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1061,23 +933,10 @@ describe('audioRendererChange', function () {
audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 0 && devDescriptor != null) {
resultFlag = true;
......@@ -1087,7 +946,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1100,7 +959,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-012] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1143,23 +1002,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 1 && devDescriptor != null) {
resultFlag = true;
......@@ -1169,7 +1015,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1182,7 +1028,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-013] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1225,23 +1071,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 2 && devDescriptor != null) {
resultFlag = true;
......@@ -1251,7 +1084,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1264,7 +1097,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-014] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1307,23 +1140,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererInfo.usage == 6 && devDescriptor != null) {
resultFlag = true;
......@@ -1333,7 +1153,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1345,7 +1165,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-015] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1388,23 +1208,10 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].streamId != undefined && devDescriptor != null) {
resultFlag = true;
......@@ -1414,7 +1221,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1426,7 +1233,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-015] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1469,25 +1276,12 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let clientUid = AudioRendererChangeInfoArray[i].clientUid;
let renFlags = AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags;
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (clientUid != undefined && renFlags == 0 && devDescriptor != null) {
resultFlag = true;
......@@ -1498,7 +1292,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1510,7 +1304,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-015] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1553,13 +1347,7 @@ describe('audioRendererChange', function () {
audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -1567,14 +1355,7 @@ describe('audioRendererChange', function () {
let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(`${Tag} : Id: ${i} ${Id}`);
console.info(`${Tag} : Type: ${i} ${dType}`);
console.info(`${Tag} : Role: ${i} ${dRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${sRate}`);
console.info(`${Tag} : CC: ${i} ${cCount}`);
console.info(`${Tag} : CM: ${i} ${cMask}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) {
resultFlag = true;
}
......@@ -1583,7 +1364,7 @@ describe('audioRendererChange', function () {
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1596,7 +1377,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [RENDERER-CHANGE-ON-018] ######### RendererChange Off is called #########`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1640,22 +1421,9 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
resultFlag = false;
}
......@@ -1667,14 +1435,14 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-001] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-001] ResultFlag is: ${resultFlag}`);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1714,7 +1482,7 @@ describe('audioRendererChange', function () {
let resultFlag = true;
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -1725,22 +1493,9 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
resultFlag = false;
}
......@@ -1752,13 +1507,13 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-002] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-002] ResultFlag is: ${resultFlag}`);
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1797,14 +1552,14 @@ describe('audioRendererChange', function () {
let resultFlag = true;
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -1814,22 +1569,9 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
resultFlag = false;
}
......@@ -1841,13 +1583,13 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-003] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-003] ResultFlag is: ${resultFlag}`);
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1888,20 +1630,20 @@ describe('audioRendererChange', function () {
let resultFlag = true;
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
});
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
......@@ -1911,22 +1653,9 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ######### RendererChange on is called for ${i} ##########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
resultFlag = false;
}
......@@ -1938,7 +1667,7 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-004] ResultFlag is: ${resultFlag}`);
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -1979,14 +1708,14 @@ describe('audioRendererChange', function () {
let resultFlag = true;
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -1996,22 +1725,9 @@ describe('audioRendererChange', function () {
audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
resultFlag = false;
}
......@@ -2023,19 +1739,19 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-005] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-005] ResultFlag is: ${resultFlag}`);
await audioRen.pause().then(async function () {
await audioRen.pause().then(function () {
console.info(`${Tag} : renderInstant Pause :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`);
});
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2079,13 +1795,7 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -2093,14 +1803,7 @@ describe('audioRendererChange', function () {
let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(`${Tag} : Id: ${i} ${Id}`);
console.info(`${Tag} : Type: ${i} ${dType}`);
console.info(`${Tag} : Role: ${i} ${dRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${sRate}`);
console.info(`${Tag} : CC: ${i} ${cCount}`);
console.info(`${Tag} : CM: ${i} ${cMask}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) {
resultFlag = false;
}
......@@ -2114,14 +1817,14 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [RENDERER-CHANGE-OFF-006] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [RENDERER-CHANGE-OFF-006] ResultFlag is: ${resultFlag}`);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2162,28 +1865,15 @@ describe('audioRendererChange', function () {
let resultFlag = false;
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -2196,22 +1886,10 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [GET_RENDERER_STATE_1_PROMISE] ######### Get Promise is called ##########`);
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 1 && devDescriptor != null) {
resultFlag = true;
......@@ -2228,7 +1906,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_1_PROMISE] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2270,7 +1948,7 @@ describe('audioRendererChange', function () {
let audioCap;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -2281,28 +1959,15 @@ describe('audioRendererChange', function () {
audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.start().then(async function () {
await audioCap.start().then(function () {
console.info(`${Tag} : Renderer started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer start :ERROR : ${err.message}`);
......@@ -2314,22 +1979,10 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [GET_RENDERER_STATE_2_PROMISE] ######### Get Promise is called ##########`);
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 2 && devDescriptor != null) {
resultFlag = true;
......@@ -2346,7 +1999,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_2_PROMISE] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2389,14 +2042,14 @@ describe('audioRendererChange', function () {
let audioCap;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRenderer Created : ERROR : ${err.message}`);
});
await audioCap.start().then(async function () {
await audioCap.start().then(function () {
console.info(`${Tag} : Renderer started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer start :ERROR : ${err.message}`);
......@@ -2406,29 +2059,16 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.stop().then(async function () {
await audioCap.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
......@@ -2440,22 +2080,10 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [GET_RENDERER_STATE_3_PROMISE] ######### Get Promise is called ##########`);
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 3 && devDescriptor != null) {
resultFlag = true;
......@@ -2472,7 +2100,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_3_PROMISE] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2515,14 +2143,14 @@ describe('audioRendererChange', function () {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -2532,29 +2160,16 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioRen.pause().then(async function () {
await audioRen.pause().then(function () {
console.info(`${Tag} : renderInstant Pause :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`);
......@@ -2566,22 +2181,10 @@ describe('audioRendererChange', function () {
console.info(`${Tag} : [GET_RENDERER_STATE_5_PROMISE] ######### Get Promise is called ##########`);
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 5 && devDescriptor != null) {
resultFlag = true;
......@@ -2598,13 +2201,13 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_5_PROMISE] ######### RendererChange Off is called #########`);
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2645,28 +2248,15 @@ describe('audioRendererChange', function () {
let resultFlag = false;
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -2676,15 +2266,10 @@ describe('audioRendererChange', function () {
await sleep(100);
await audioStreamManager.getCurrentAudioRendererInfoArray().then(function (AudioRendererChangeInfoArray) {
console.info(`${Tag} : '[GET_RENDERER_DD_PROMISE] ######### Get Promise is called ##########`);
console.info(`${Tag} : [GET_RENDERER_DD_PROMISE] ######### Get Promise is called ##########`);
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -2692,14 +2277,7 @@ describe('audioRendererChange', function () {
let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(`${Tag} : Id: ${i} ${Id}`);
console.info(`${Tag} : Type: ${i} ${dType}`);
console.info(`${Tag} : Role: ${i} ${dRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${sRate}`);
console.info(`${Tag} : CC: ${i} ${cCount}`);
console.info(`${Tag} : CM: ${i} ${cMask}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) {
resultFlag = true;
}
......@@ -2713,9 +2291,9 @@ describe('audioRendererChange', function () {
audioStreamManager.off('audioRendererChange');
await sleep(100);
console.info(`${Tag} : '[GET_RENDERER_DD_PROMISE] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [GET_RENDERER_DD_PROMISE] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2756,28 +2334,15 @@ describe('audioRendererChange', function () {
let resultFlag = false;
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -2796,22 +2361,10 @@ describe('audioRendererChange', function () {
else {
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 1 && devDescriptor != null) {
resultFlag = true;
......@@ -2828,7 +2381,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_1_CALLBACK] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2870,7 +2423,7 @@ describe('audioRendererChange', function () {
let audioCap;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -2881,28 +2434,15 @@ describe('audioRendererChange', function () {
audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.start().then(async function () {
await audioCap.start().then(function () {
console.info(`${Tag} : Renderer started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer start :ERROR : ${err.message}`);
......@@ -2920,22 +2460,10 @@ describe('audioRendererChange', function () {
else {
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 2 && devDescriptor != null) {
resultFlag = true;
......@@ -2952,7 +2480,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_2_CALLBACK] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -2994,14 +2522,14 @@ describe('audioRendererChange', function () {
let audioCap;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRenderer Created : ERROR : ${err.message}`);
});
await audioCap.start().then(async function () {
await audioCap.start().then(function () {
console.info(`${Tag} : Renderer started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer start :ERROR : ${err.message}`);
......@@ -3011,29 +2539,16 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioCap.stop().then(async function () {
await audioCap.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
......@@ -3051,22 +2566,10 @@ describe('audioRendererChange', function () {
else {
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 3 && devDescriptor != null) {
resultFlag = true;
......@@ -3083,7 +2586,7 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info(`${Tag} : [GET_RENDERER_STATE_3_CALLBACK] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -3125,14 +2628,14 @@ describe('audioRendererChange', function () {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioRen = data;
console.info(`${Tag} : AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : AudioRender Created : ERROR : ${err.message}`);
});
await audioRen.start().then(async function () {
await audioRen.start().then(function () {
console.info(`${Tag} : renderInstant started :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant start :ERROR : ${err.message}`);
......@@ -3142,29 +2645,16 @@ describe('audioRendererChange', function () {
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audioRen.pause().then(async function () {
await audioRen.pause().then(function () {
console.info(`${Tag} : renderInstant Pause :SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : renderInstant Pause :ERROR : ${err.message}`);
......@@ -3182,22 +2672,10 @@ describe('audioRendererChange', function () {
else {
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
let devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors;
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
if (AudioRendererChangeInfoArray[i].rendererState == 5 && devDescriptor != null) {
resultFlag = true;
......@@ -3214,13 +2692,13 @@ describe('audioRendererChange', function () {
await sleep(100);
console.info('AFRendLog: [GET_REN_STA_5_CB] ## RenCh Off is called ##');
await audioRen.stop().then(async function () {
await audioRen.stop().then(function () {
console.info(`${Tag} : Renderer stopped : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer stop:ERROR : ${err.message}`);
});
await audioRen.release().then(async function () {
await audioRen.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......@@ -3261,28 +2739,15 @@ describe('audioRendererChange', function () {
let resultFlag = false;
audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : ## RendererChange on is called for ${i} ##`);
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Content for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream for ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : Flag ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : ## RendererChange on is called for ${i} ## ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
console.info(`${Tag} : Id: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].id}`);
console.info(`${Tag} : Type: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType}`);
console.info(`${Tag} : Role: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole}`);
console.info(`${Tag} : Name: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : Addr: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]}`);
console.info(`${Tag} : C: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]}`);
console.info(`${Tag} : CM: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
}
}
});
await sleep(100);
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then(function (data) {
audioCap = data;
console.info(`${Tag} : AudioRenderer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -3292,7 +2757,7 @@ describe('audioRendererChange', function () {
await sleep(100);
audioStreamManager.getCurrentAudioRendererInfoArray(async (err, AudioRendererChangeInfoArray) => {
console.info(`${Tag} : '[GET_RENDERER_DD_CALLBACK] **** Get Callback Called ****`);
console.info(`${Tag} : [GET_RENDERER_DD_CALLBACK] **** Get Callback Called ****`);
await sleep(100);
if (err) {
console.log(`${Tag} : getCurrentAudioRendererInfoArray :ERROR: ${err.message}`);
......@@ -3301,12 +2766,7 @@ describe('audioRendererChange', function () {
else {
if (AudioRendererChangeInfoArray != null) {
for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) {
console.info(`${Tag} : StreamId for ${i} is: ${AudioRendererChangeInfoArray[i].streamId}`);
console.info(`${Tag} : ClientUid for ${i} is: ${AudioRendererChangeInfoArray[i].clientUid}`);
console.info(`${Tag} : Con ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.content}`);
console.info(`${Tag} : Stream ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.usage}`);
console.info(`${Tag} : ${i} is: ${AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags}`);
console.info(`${Tag} : State for ${i} is: ${AudioRendererChangeInfoArray[i].rendererState}`);
console.info(`${Tag} : AudioRendererChangeInfo for ${i} is: ${JSON.stringify(AudioRendererChangeInfoArray[i])}`);
for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) {
let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id;
let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType;
......@@ -3314,14 +2774,7 @@ describe('audioRendererChange', function () {
let sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0];
let cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0];
let cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks;
console.info(`${Tag} : Id: ${i} ${Id}`);
console.info(`${Tag} : Type: ${i} ${dType}`);
console.info(`${Tag} : Role: ${i} ${dRole}`);
console.info(`${Tag} : Nam: ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].name}`);
console.info(`${Tag} : ${i} ${AudioRendererChangeInfoArray[i].deviceDescriptors[j].address}`);
console.info(`${Tag} : SR: ${i} ${sRate}`);
console.info(`${Tag} : CC: ${i} ${cCount}`);
console.info(`${Tag} : CM: ${i} ${cMask}`);
console.info(`${Tag} : ${i} ${JSON.stringify(AudioRendererChangeInfoArray[i].deviceDescriptors[j])}`);
if (Id > 0 && dType == 2 && dRole == 2 && sRate != null && cCount != null && cMask != null) {
resultFlag = true;
}
......@@ -3335,9 +2788,9 @@ describe('audioRendererChange', function () {
audioStreamManager.off('audioRendererChange');
await sleep(100);
console.info(`${Tag} : '[GET_RENDERER_DD_CALLBACK] ######### RendererChange Off is called #########`);
console.info(`${Tag} : [GET_RENDERER_DD_CALLBACK] ######### RendererChange Off is called #########`);
await audioCap.release().then(async function () {
await audioCap.release().then(function () {
console.info(`${Tag} : Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${Tag} : Renderer release :ERROR : ${err.message}`);
......
......@@ -21,20 +21,20 @@ import account from '@ohos.account.osAccount';
// apply permission for test hap
export async function applyPermission(applictionName, permissionNames) {
let userId = await account.getAccountManager().getOsAccountLocalIdFromProcess();
console.info('userid is :' + userId)
console.info(`userid is :${userId}`)
let appInfo = await bundle.getApplicationInfo(applictionName, 0, userId);
let atManager = abilityAccessCtrl.createAtManager();
if (atManager != null) {
let tokenID = appInfo.accessTokenId;
console.info('[permission] case accessTokenID is ' + tokenID);
console.info(`[permission] case accessTokenID is ${tokenID}`);
for (let i = 0; i < permissionNames.length; i++) {
await atManager.grantUserGrantedPermission(tokenID, permissionNames[i], 1).then((result) => {
console.info('[permission] case grantUserGrantedPermission success :' + result);
console.info(`[permission] case grantUserGrantedPermission success : ${result}`);
}).catch((err) => {
console.info('[permission] case grantUserGrantedPermission failed :' + err);
console.info(`[permission] case grantUserGrantedPermission failed : ${err}`);
});
}
} else {
console.info('[permission] case apply permission failed, createAtManager failed');
console.info(`[permission] case apply permission failed, createAtManager failed`);
}
}
\ No newline at end of file
......@@ -51,7 +51,7 @@ describe('audioVoip', function () {
console.info(`AudioFrameworkTest: afterEach: Test case-level clearance conditions`);
})
afterAll(async function () {
afterAll(function () {
console.info(`AudioFrameworkTest: afterAll: Test suite-level cleanup condition`);
})
......@@ -111,7 +111,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: Promise : Audio Playback Function`);
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then((data) => {
audioRen = data;
console.info(`${TagRender}: AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -123,7 +123,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
await audioRen.getStreamInfo().then(async function (audioParamsGet) {
await audioRen.getStreamInfo().then((audioParamsGet) => {
console.info(`${TagRender}: Renderer getStreamInfo:`);
console.info(`${TagRender}: Renderer sampleFormat: ${audioParamsGet.sampleFormat}`);
console.info(`${TagRender}: Renderer samplingRate: ${audioParamsGet.samplingRate}`);
......@@ -138,7 +138,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioRen.getRendererInfo().then(async function (audioParamsGet) {
await audioRen.getRendererInfo().then((audioParamsGet) => {
console.info(`${TagRender}: Renderer RendererInfo:`);
console.info(`${TagRender}: Renderer content type: ${audioParamsGet.content}`);
console.info(`${TagRender}: Renderer usage: ${audioParamsGet.usage}`);
......@@ -152,7 +152,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioRen.start().then(async function () {
await audioRen.start().then(() => {
console.info(`${TagRender}: renderInstant started :SUCCESS `);
}).catch((err) => {
console.info(`${TagRender}: renderInstant start :ERROR : ${err.message}`);
......@@ -166,7 +166,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
let bufferSize;
await audioRen.getBufferSize().then(async function (data) {
await audioRen.getBufferSize().then((data) => {
console.info(`${TagRender}: getBufferSize :SUCCESS ${data}`);
bufferSize = data;
}).catch((err) => {
......@@ -193,7 +193,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: BufferAudioFramework: bytes read from file: ${rlen}`);
await audioRen.write(buf);
if (rlen > (totalSize / 2)) {
await AUDIOMANAGER.getAudioScene().then(async function (data) {
await AUDIOMANAGER.getAudioScene().then((data) => {
console.info(`${TagRender}:AudioFrameworkAudioScene: getAudioScene : Value : ${data}`);
}).catch((err) => {
console.info(`${TagRender}:AudioFrameworkAudioScene: getAudioScene : ERROR : ${err.message}`);
......@@ -203,7 +203,7 @@ describe('audioVoip', function () {
}
console.info(`${TagRender}: Renderer after read`);
await audioRen.drain().then(async function () {
await audioRen.drain().then(() => {
console.info(`${TagRender}: Renderer drained : SUCCESS`);
}).catch((err) => {
console.error(`${TagRender}: Renderer drain: ERROR : ${err.message}`);
......@@ -216,7 +216,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
await audioRen.stop().then(async function () {
await audioRen.stop().then(() => {
console.info(`${TagRender}: Renderer stopped : SUCCESS`);
resultFlag = true;
console.info(`${TagRender}: resultFlagRen : ${resultFlag}`);
......@@ -227,7 +227,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
await audioRen.release().then(async function () {
await audioRen.release().then(() => {
console.info(`${TagRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagRender}: Renderer release :ERROR : ${err.message}`);
......@@ -247,7 +247,7 @@ describe('audioVoip', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(`${TagRec}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -259,7 +259,7 @@ describe('audioVoip', function () {
console.info(`${TagRec}: AudioCapturer : STATE : ${audioCap.state}`);
await audioCap.getStreamInfo().then(async function (audioParamsGet) {
await audioCap.getStreamInfo().then((audioParamsGet) => {
if (audioParamsGet != undefined) {
console.info(`${TagRec}: Capturer getStreamInfo:`);
console.info(`${TagRec}: Capturer sampleFormat: ${audioParamsGet.sampleFormat}`);
......@@ -280,7 +280,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioCap.getCapturerInfo().then(async function (audioParamsGet) {
await audioCap.getCapturerInfo().then((audioParamsGet) => {
if (audioParamsGet != undefined) {
console.info(`${TagRec}: Capturer CapturerInfo:`);
console.info(`${TagRec}: Capturer SourceType: ${audioParamsGet.source}`);
......@@ -299,7 +299,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioCap.start().then(async function () {
await audioCap.start().then(() => {
console.info(`${TagRec}: Capturer started :SUCCESS`);
}).catch((err) => {
console.info(`${TagRec}: Capturer start :ERROR : ${err.message}`);
......@@ -349,7 +349,7 @@ describe('audioVoip', function () {
await sleep(1000);
console.info(`${TagRec}: AudioCapturer : STATE : ${audioCap.state}`);
await audioCap.stop().then(async function () {
await audioCap.stop().then(() => {
console.info(`${TagRec}: Capturer stopped : SUCCESS`);
resultFlag = true;
console.info(`${TagRec}: resultFlag : ${resultFlag}`);
......@@ -360,7 +360,7 @@ describe('audioVoip', function () {
console.info(`${TagRec}: AudioCapturer : STATE : ${audioCap.state}`);
await audioCap.release().then(async function () {
await audioCap.release().then(() => {
console.info(`${TagRec}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagRec}: Capturer release :ERROR : ${err.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册