diff --git a/multimedia/audio/audio_js_standard/AudioCapturer/Test.json b/multimedia/audio/audio_js_standard/AudioCapturer/Test.json index 0a07b77ae673f0e0f7bc202b6184ce22347f3d4c..293b46d11ce0c3f5d2d159b69c7389648aeac40e 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturer/Test.json +++ b/multimedia/audio/audio_js_standard/AudioCapturer/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "1500000", "package": "ohos.acts.multimedia.audio.audiocapturer", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js b/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js index 61917879d8c6390b4716400a769a6de0cd330303..e65b8cc614ded6f1b054d39891cb73b745f6b05d 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js +++ b/multimedia/audio/audio_js_standard/AudioCapturer/src/main/js/test/AudioCapturer.test.js @@ -17,13 +17,12 @@ import audio from '@ohos.multimedia.audio'; import fileio from '@ohos.fileio'; import featureAbility from '@ohos.ability.featureAbility' import * as audioTestBase from '../../../../../AudioTestBase' - import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; describe('audioCapturer', function () { - var audioCapCallBack; - var audioCapPromise; - var dirPath; + let audioCapCallBack; + let audioCapPromise; + let dirPath; async function getFd(fileName) { let context = await featureAbility.getContext(); await context.getFilesDir().then((data) => { @@ -40,7 +39,7 @@ describe('audioCapturer', function () { }); }); } - const audioManagerRec = audio.getAudioManager(); + const AUDIOMANAGERREC = audio.getAudioManager(); console.info('AudioFrameworkRecLog: Create AudioManger Object JS Framework'); beforeAll(async function () { console.info('AudioFrameworkTest: beforeAll: Prerequisites at the test suite level'); @@ -74,10 +73,10 @@ describe('audioCapturer', function () { async function recPromise(AudioCapturerOptions, dirPath, AudioScene) { - var resultFlag = 'new'; + let resultFlag = 'new'; console.info('AudioFrameworkRecLog: Promise : Audio Recording Function'); - var audioCap; + let audioCap; let isPass = false; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -156,10 +155,10 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - var bufferSize = await audioCap.getBufferSize(); + let bufferSize = await audioCap.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } @@ -179,13 +178,13 @@ describe('audioCapturer', function () { return resultFlag; } await sleep(100); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------READ BUFFER---------'); - var buffer = await audioCap.read(bufferSize, true); + let buffer = await audioCap.read(bufferSize, true); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(50); numBuffersToCapture--; @@ -220,7 +219,7 @@ describe('audioCapturer', function () { async function recCallBack(AudioCapturerOptions, dirPath, AudioScene) { - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRecLog: CallBack : Audio Recording Function'); audio.createAudioCapturer(AudioCapturerOptions, async (err, value) => { if (err) { @@ -231,7 +230,7 @@ describe('audioCapturer', function () { } }); await sleep(1000); - audioManagerRec.getAudioScene(async (err, getValue) => { + AUDIOMANAGERREC.getAudioScene((err, getValue) => { console.info('AudioFrameworkRecLog: ---------GET AUDIO SCENE---------'); if (err) { console.info('AudioFrameworkRecLog: getAudioScene : ERROR : ' + err.message); @@ -257,7 +256,7 @@ describe('audioCapturer', function () { } }); await sleep(1000); - audioCapCallBack.getCapturerInfo(async (err, audioParamsGet) => { + audioCapCallBack.getCapturerInfo((err, audioParamsGet) => { console.info('AudioFrameworkRecLog: ---------GET CAPTURER INFO---------'); if (err) { console.log('AudioFrameworkRecLog: CapturerInfo :ERROR: ' + err.message); @@ -269,7 +268,7 @@ describe('audioCapturer', function () { } }); await sleep(1000); - audioCapCallBack.start(async (err, value) => { + audioCapCallBack.start((err, value) => { console.info('AudioFrameworkRecLog: AudioCapturer : START SUCCESS'); console.info('AudioFrameworkRecLog: ---------START---------'); if (err) { @@ -278,16 +277,15 @@ describe('audioCapturer', function () { } else { console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCapCallBack.state); console.info('AudioFrameworkRecLog: Capturer started :SUCCESS '); - await sleep(1000); } }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -305,13 +303,13 @@ describe('audioCapturer', function () { return resultFlag; } - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------READ BUFFER---------'); - var buffer = await audioCapCallBack.read(bufferSize, true); + let buffer = await audioCapCallBack.read(bufferSize, true); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(50); numBuffersToCapture--; @@ -358,20 +356,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -408,20 +406,20 @@ describe('audioCapturer', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_EUNM_0100', 0, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -453,20 +451,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -524,20 +522,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_EUNM_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -596,20 +594,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -684,20 +682,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_EUNM_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -767,20 +765,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RELEASED_STATE_0100', 2, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -855,20 +853,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RELEASED_STATE_EUNM_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -944,20 +942,20 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100', 1, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -988,7 +986,7 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(async (err, cbbufferSize) => { + let bufferSize = await audioCapCallBack.getBufferSize(async (err, cbbufferSize) => { if (err) { console.info('AudioFrameworkRecLog: Capturer release :ERROR : ' + err.message); stateFlag = false; @@ -1029,21 +1027,21 @@ describe('audioCapturer', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_0100', 1, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1073,11 +1071,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -1093,7 +1091,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -1107,7 +1105,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -1149,20 +1147,20 @@ describe('audioCapturer', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_0100', 0, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1192,20 +1190,20 @@ describe('audioCapturer', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMOISE_PREPARED_STATE_ENUM_0100', 0, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1236,20 +1234,20 @@ describe('audioCapturer', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_0100', 0, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1301,20 +1299,20 @@ describe('audioCapturer', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RUNNING_STATE_ENUM_0100', 0, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1366,20 +1364,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_0100', 2, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1442,20 +1440,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOPPED_STATE_ENUM_0100', 2, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1519,20 +1517,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_0100', 2, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1593,20 +1591,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASED_STATE_ENUM_0100', 2, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1668,20 +1666,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_BUFFER_SIZE_0100', 2, async function (done) { - var stateFlag; - var AudioStreamInfo = { + let stateFlag; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1708,7 +1706,7 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapPromise.getBufferSize(); + let bufferSize = await audioCapPromise.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); stateFlag = true; console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); @@ -1742,21 +1740,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_READ_BUFFER_0100', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkpromisereadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -1784,12 +1782,12 @@ describe('audioCapturer', function () { await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapPromise.getBufferSize(); + let bufferSize = await audioCapPromise.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); stateFlag = true; console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -1805,14 +1803,14 @@ describe('audioCapturer', function () { stateFlag = false; } //await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE PROMISE READ ---------'); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - var buffer = await audioCapPromise.read(bufferSize, true); + let buffer = await audioCapPromise.read(bufferSize, true); console.info('AudioFrameworkRecLog: ---------AFTER PROMISE READ ---------'); //await sleep(50); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('BufferRecLog: data written: ' + number); console.info('AudioFrameworkRecLog: ---------AFTER PROMISE WRITE ---------'); //await sleep(100); @@ -1849,25 +1847,25 @@ describe('audioCapturer', function () { */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_CB_js-44100-2C-16B.pcm"); - var resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(1000); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1884,25 +1882,25 @@ describe('audioCapturer', function () { */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_CB_ENUM_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0 } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: 1, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_CB_js-44100-2C-16B.pcm"); - var resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recCallBack(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(1000); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1918,25 +1916,25 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_js-44100-2C-16B.pcm"); - var resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -1954,25 +1952,25 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0 } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: 1, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getFd("capture_js-44100-2C-16B.pcm"); - var resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(AudioCapturerOptions, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -1990,23 +1988,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0200', 2, async function (done) { - var audioStreamInfo44100 = { + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions44100 = { + let audioCapturerOptions44100 = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } await getFd("capture_js-44100-1C-16LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2024,24 +2022,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0200', 2, async function (done) { - var audioStreamInfo44100 = { + let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions44100 = { + let audioCapturerOptions44100 = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } await getFd("capture_js-44100-1C-16LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2059,23 +2057,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0300', 2, async function (done) { - var audioStreamInfo96000 = { + let audioStreamInfo96000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_96000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo96000 = { + let audioCapturerInfo96000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions96000 = { + let audioCapturerOptions96000 = { streamInfo: audioStreamInfo96000, capturerInfo: audioCapturerInfo96000, } await getFd("capture_js-96000-1C-S24LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2093,23 +2091,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0300', 2, async function (done) { - var audioStreamInfo96000 = { + let audioStreamInfo96000 = { samplingRate: 96000, channels: 1, sampleFormat: 2, encodingType: 0, }; - var audioCapturerInfo96000 = { + let audioCapturerInfo96000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions96000 = { + let audioCapturerOptions96000 = { streamInfo: audioStreamInfo96000, capturerInfo: audioCapturerInfo96000, } await getFd("capture_js-96000-1C-S24LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions96000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2127,23 +2125,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0400', 2, async function (done) { - var audioStreamInfo48000 = { + let audioStreamInfo48000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo48000 = { + let audioCapturerInfo48000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions48000 = { + let audioCapturerOptions48000 = { streamInfo: audioStreamInfo48000, capturerInfo: audioCapturerInfo48000, } await getFd("capture_js-48000-2C-1S32LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2161,23 +2159,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0400', 2, async function (done) { - var audioStreamInfo48000 = { + let audioStreamInfo48000 = { samplingRate: 48000, channels: 2, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo48000 = { + let audioCapturerInfo48000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions48000 = { + let audioCapturerOptions48000 = { streamInfo: audioStreamInfo48000, capturerInfo: audioCapturerInfo48000, } await getFd("capture_js-48000-2C-1S32LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions48000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2195,23 +2193,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0500', 2, async function (done) { - var audioStreamInfo8000 = { + let audioStreamInfo8000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_8000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo8000 = { + let audioCapturerInfo8000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions8000 = { + let audioCapturerOptions8000 = { streamInfo: audioStreamInfo8000, capturerInfo: audioCapturerInfo8000, } await getFd("capture_js-8000-1C-8B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2229,23 +2227,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0500', 2, async function (done) { - var audioStreamInfo8000 = { + let audioStreamInfo8000 = { samplingRate: 8000, channels: 1, sampleFormat: 0, encodingType: 0, }; - var audioCapturerInfo8000 = { + let audioCapturerInfo8000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions8000 = { + let audioCapturerOptions8000 = { streamInfo: audioStreamInfo8000, capturerInfo: audioCapturerInfo8000, } await getFd("capture_js-8000-1C-8B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions8000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2263,23 +2261,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0600', 2, async function (done) { - var audioStreamInfo11025 = { + let audioStreamInfo11025 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_11025, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo11025 = { + let audioCapturerInfo11025 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions11025 = { + let audioCapturerOptions11025 = { streamInfo: audioStreamInfo11025, capturerInfo: audioCapturerInfo11025, } await getFd("capture_js-11025-2C-16B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2297,24 +2295,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0600', 2, async function (done) { - var audioStreamInfo11025 = { + let audioStreamInfo11025 = { samplingRate: 11025, channels: 2, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo11025 = { + let audioCapturerInfo11025 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions11025 = { + let audioCapturerOptions11025 = { streamInfo: audioStreamInfo11025, capturerInfo: audioCapturerInfo11025, } await getFd("capture_js-11025-2C-16B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions11025, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2332,23 +2330,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0700', 2, async function (done) { - var audioStreamInfo12000 = { + let audioStreamInfo12000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_12000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo12000 = { + let audioCapturerInfo12000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions12000 = { + let audioCapturerOptions12000 = { streamInfo: audioStreamInfo12000, capturerInfo: audioCapturerInfo12000, } await getFd("capture_js-12000-1C-24B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2366,23 +2364,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0700', 2, async function (done) { - var audioStreamInfo12000 = { + let audioStreamInfo12000 = { samplingRate: 12000, channels: 1, sampleFormat: 2, encodingType: 0 }; - var audioCapturerInfo12000 = { + let audioCapturerInfo12000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions12000 = { + let audioCapturerOptions12000 = { streamInfo: audioStreamInfo12000, capturerInfo: audioCapturerInfo12000, } await getFd("capture_js-12000-1C-24B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions12000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2400,23 +2398,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0800', 2, async function (done) { - var audioStreamInfo16000 = { + let audioStreamInfo16000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_16000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo16000 = { + let audioCapturerInfo16000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions16000 = { + let audioCapturerOptions16000 = { streamInfo: audioStreamInfo16000, capturerInfo: audioCapturerInfo16000, } await getFd("capture_js-16000-2C-32B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2434,23 +2432,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0800', 2, async function (done) { - var audioStreamInfo16000 = { + let audioStreamInfo16000 = { samplingRate: 16000, channels: 2, sampleFormat: 3, encodingType: 0, }; - var audioCapturerInfo16000 = { + let audioCapturerInfo16000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions16000 = { + let audioCapturerOptions16000 = { streamInfo: audioStreamInfo16000, capturerInfo: audioCapturerInfo16000, } await getFd("capture_js-16000-2C-32B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions16000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2468,23 +2466,23 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_0900', 2, async function (done) { - var audioStreamInfo22050 = { + let audioStreamInfo22050 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_22050, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo22050 = { + let audioCapturerInfo22050 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions22050 = { + let audioCapturerOptions22050 = { streamInfo: audioStreamInfo22050, capturerInfo: audioCapturerInfo22050, } await getFd("capture_js-22050-1C-8B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2502,24 +2500,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_0900', 2, async function (done) { - var audioStreamInfo22050 = { + let audioStreamInfo22050 = { samplingRate: 22050, channels: 1, sampleFormat: 0, encodingType: 0, }; - var audioCapturerInfo22050 = { + let audioCapturerInfo22050 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions22050 = { + let audioCapturerOptions22050 = { streamInfo: audioStreamInfo22050, capturerInfo: audioCapturerInfo22050, } await getFd("capture_js-22050-1C-8B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions22050, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2537,24 +2535,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_1000', 2, async function (done) { - var audioStreamInfo24000 = { + let audioStreamInfo24000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo24000 = { + let audioCapturerInfo24000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions24000 = { + let audioCapturerOptions24000 = { streamInfo: audioStreamInfo24000, capturerInfo: audioCapturerInfo24000, } await getFd("capture_js-24000-2C-16B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2572,24 +2570,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_1000', 2, async function (done) { - var audioStreamInfo24000 = { + let audioStreamInfo24000 = { samplingRate: 24000, channels: 2, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo24000 = { + let audioCapturerInfo24000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions24000 = { + let audioCapturerOptions24000 = { streamInfo: audioStreamInfo24000, capturerInfo: audioCapturerInfo24000, } await getFd("capture_js-24000-2C-16B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions24000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2607,24 +2605,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_1100', 2, async function (done) { - var audioStreamInfo32000 = { + let audioStreamInfo32000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_32000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo32000 = { + let audioCapturerInfo32000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions32000 = { + let audioCapturerOptions32000 = { streamInfo: audioStreamInfo32000, capturerInfo: audioCapturerInfo32000, } await getFd("capture_js-32000-1C-24B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2642,24 +2640,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_1100', 2, async function (done) { - var audioStreamInfo32000 = { + let audioStreamInfo32000 = { samplingRate: 32000, channels: 1, sampleFormat: 2, encodingType: 0, }; - var audioCapturerInfo32000 = { + let audioCapturerInfo32000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions32000 = { + let audioCapturerOptions32000 = { streamInfo: audioStreamInfo32000, capturerInfo: audioCapturerInfo32000, } await getFd("capture_js-32000-1C-24B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions32000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2677,24 +2675,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_1200', 2, async function (done) { - var audioStreamInfo64000 = { + let audioStreamInfo64000 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_64000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo64000 = { + let audioCapturerInfo64000 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions64000 = { + let audioCapturerOptions64000 = { streamInfo: audioStreamInfo64000, capturerInfo: audioCapturerInfo64000, } await getFd("capture_js-64000-2C-32B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2713,24 +2711,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_VOICE_CHAT_PROMISE_ENUM_1200', 2, async function (done) { - var audioStreamInfo64000 = { + let audioStreamInfo64000 = { samplingRate: 64000, channels: 2, sampleFormat: 3, encodingType: 0, }; - var audioCapturerInfo64000 = { + let audioCapturerInfo64000 = { source: 1, capturerFlags: 0 } - var audioCapturerOptions64000 = { + let audioCapturerOptions64000 = { streamInfo: audioStreamInfo64000, capturerInfo: audioCapturerInfo64000, } await getFd("capture_js-64000-2C-32B.pcm"); - var resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await recPromise(audioCapturerOptions64000, dirPath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2748,24 +2746,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RECORD_PROMISE_AUDIO_SCENE_DEFAULT_0100', 2, async function (done) { - var audioStreamInfo44100 = { + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions44100 = { + let audioCapturerOptions44100 = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } await getFd("capture_js-44100-1C-16LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_DEFAULT); + let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -2781,24 +2779,24 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RECORD_PROMISE_AUDIO_SCENE_DEFAULT_ENUM_0100', 2, async function (done) { - var audioStreamInfo44100 = { + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var audioCapturerOptions44100 = { + let audioCapturerOptions44100 = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } await getFd("capture_js-44100-1C-16LE.pcm"); - var resultFlag = await recPromise(audioCapturerOptions44100, dirPath, 0); + let resultFlag = await recPromise(audioCapturerOptions44100, dirPath, 0); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2816,21 +2814,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_START_0100', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -2915,21 +2913,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_READ_WRITE_0100', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -2970,11 +2968,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -2990,7 +2988,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -3013,7 +3011,7 @@ describe('audioCapturer', function () { }); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -3066,21 +3064,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_GET_AUDIO_TIME_AFTER_STOP_0100', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -3121,11 +3119,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -3141,7 +3139,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -3164,7 +3162,7 @@ describe('audioCapturer', function () { }); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -3240,21 +3238,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_AUDIO_TIME_0100', 2, async function (done) { - var stateFlag; - var audioCapCallBack; - var AudioStreamInfo = { + let stateFlag; + let audioCapCallBack; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -3324,21 +3322,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_STOP_BEFORE_START_0100', 2, async function (done) { - var stateFlag; - var audioCapPromise; - var AudioStreamInfo = { + let stateFlag; + let audioCapPromise; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -3395,21 +3393,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_PROMISE_RELEASE_BEFORE_START_0100', 2, async function (done) { - var stateFlag; - var audioCapPromise; - var AudioStreamInfo = { + let stateFlag; + let audioCapPromise; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -3464,20 +3462,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_0100', 2, async function (done) { - var audioCapGetgetStreamInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetStreamInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3540,19 +3538,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_STREAM_INFO_ENUM_0100', 2, async function (done) { - var audioCapGetgetStreamInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetStreamInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3617,20 +3615,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_0200', 2, async function (done) { - var audioCapGetgetStreamInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetStreamInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3696,19 +3694,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_ENUM_0200', 2, async function (done) { - var audioCapGetgetStreamInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetStreamInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3775,20 +3773,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_0300', 2, async function (done) { - var audioCapGetgetCapturerInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetCapturerInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3847,19 +3845,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_PR_VOICE_CHAT_GET_CAPTURER_INFO_ENUM_0300', 2, async function (done) { - var audioCapGetgetCapturerInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetCapturerInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3918,20 +3916,20 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_CAPTURER_INFO_0400', 2, async function (done) { - var audioCapGetgetCapturerInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetCapturerInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -3994,19 +3992,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_CB_VOICE_CHAT_GET_STREAM_INFO_ENUM_0400', 2, async function (done) { - var audioCapGetgetCapturerInfo; - var setFlag; - var audioStreamInfo44100 = { + let audioCapGetgetCapturerInfo; + let setFlag; + let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -4068,22 +4066,22 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_VOICE_CHAT_PR_ENUM_AUDIO_STREAM_INFO_INVALID_0100', 2, async function (done) { - var audioStreamInfo44100 = { + let audioStreamInfo44100 = { samplingRate: 0, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) { if (data == undefined) { @@ -4107,17 +4105,17 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_REC_VOICE_CHAT_PR_ENUM_AUDIO_CAPTURER_INFO_INVALID_0100', 2, async function (done) { - var audioStreamInfo44100 = { + let audioStreamInfo44100 = { samplingRate: 44100, channels: 1, sampleFormat: 1, encodingType: 0, }; - var audioCapturerInfo44100 = { + let audioCapturerInfo44100 = { source: 1000, capturerFlags: 0 } - var AudioCapturerOptionsInvalid = { + let AudioCapturerOptionsInvalid = { streamInfo: audioStreamInfo44100, capturerInfo: audioCapturerInfo44100, } @@ -4145,19 +4143,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0100', 2, async function (done) { - var stateFlag; - var audioCapCallBack; - var AudioStreamInfo = { + let stateFlag; + let audioCapCallBack; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4260,19 +4258,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0200', 2, async function (done) { - var stateFlag; - var audioCapCallBack; - var AudioStreamInfo = { + let stateFlag; + let audioCapCallBack; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4341,19 +4339,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300', 2, async function (done) { - var stateFlag; - var audioCapCallBack; - var AudioStreamInfo = { + let stateFlag; + let audioCapCallBack; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4438,19 +4436,19 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0400', 2, async function (done) { - var stateFlag; - var audioCapCallBack; - var AudioStreamInfo = { + let stateFlag; + let audioCapCallBack; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4554,21 +4552,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0100', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4610,11 +4608,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -4630,7 +4628,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -4644,7 +4642,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -4692,21 +4690,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0200', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4748,11 +4746,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -4768,7 +4766,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -4782,7 +4780,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -4824,21 +4822,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0300', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -4880,11 +4878,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -4900,7 +4898,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -4914,7 +4912,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -4957,21 +4955,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0400', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5013,11 +5011,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5033,7 +5031,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5047,7 +5045,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5090,21 +5088,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0500', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5146,11 +5144,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5166,7 +5164,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5180,7 +5178,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5224,21 +5222,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0600', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5280,11 +5278,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5300,7 +5298,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5314,7 +5312,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5358,21 +5356,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0700', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5414,11 +5412,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5434,7 +5432,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5448,7 +5446,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5491,21 +5489,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_MARK_REACH_0800', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5547,11 +5545,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5567,7 +5565,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5581,7 +5579,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5624,21 +5622,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0100', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5678,11 +5676,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5698,7 +5696,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5712,7 +5710,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5779,21 +5777,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0200', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5833,11 +5831,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -5853,7 +5851,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -5867,7 +5865,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -5934,21 +5932,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0300', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -5988,11 +5986,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -6008,7 +6006,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -6022,7 +6020,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; @@ -6090,21 +6088,21 @@ describe('audioCapturer', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_READ_BUFFER_PERIOD_REACH_0400', 2, async function (done) { - var stateFlag; + let stateFlag; await getFd("capture_CB_js-44100-2C-S16LE-checkcbreadbuffer.pcm"); - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } @@ -6144,11 +6142,11 @@ describe('audioCapturer', function () { }); await sleep(1000); console.info('AudioFrameworkRecLog: ---------GET BUFFER SIZE---------'); - var bufferSize = await audioCapCallBack.getBufferSize(); + let bufferSize = await audioCapCallBack.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); await sleep(1000); console.info('AudioFrameworkRecLog: ---------OPEN FILE---------'); - var fd = fileio.openSync(dirPath, 0o102, 0o777); + let fd = fileio.openSync(dirPath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } else { @@ -6164,7 +6162,7 @@ describe('audioCapturer', function () { stateFlag = false; } await sleep(1000); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------BEFORE CHECK CB READ BUFFER---------'); await new Promise((resolve, reject) => { @@ -6178,7 +6176,7 @@ describe('audioCapturer', function () { console.info('AudioFrameworkRecLog: AudioCapturer : readvalue : ' + buffer); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(100); stateFlag = true; diff --git a/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/Test.json b/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/Test.json index 54770c8709c6e23d8d068df859a8b20766616c8d..124200ba9f94ead457c0686c9d3a4161a814d47d 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/Test.json +++ b/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "1500000", "package": "ohos.acts.multimedia.audio.audiocapturerchangeInfo", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js b/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js index 596555ffb55abaf77f767cab779123858c87123d..e3b1a3bd23e52d0f938d92cf5349a8a383983f3f 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js +++ b/multimedia/audio/audio_js_standard/AudioCapturerChangeInfo/src/main/js/test/AudioCapturerChangeInfo.test.js @@ -18,9 +18,9 @@ import * as audioTestBase from '../../../../../AudioTestBase' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; describe('audioCapturerChange', function () { - var audioStreamManager; - var audioStreamManagerCB; - var Tag = "AFCapLog : "; + let audioStreamManager; + let audioStreamManagerCB; + let Tag = "AFCapLog : "; const audioManager = audio.getAudioManager(); console.info(Tag + 'Create AudioManger Object JS Framework'); @@ -81,25 +81,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0100', 1, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -108,7 +108,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -160,26 +160,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -198,7 +198,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -249,26 +249,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -293,7 +293,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -345,26 +345,26 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -395,7 +395,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -440,26 +440,26 @@ describe('audioCapturerChange', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0500', 0, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { @@ -469,7 +469,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -521,26 +521,26 @@ describe('audioCapturerChange', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0600', 0, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; audioStreamManagerCB.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { @@ -550,7 +550,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -603,25 +603,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0700', 0, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -630,7 +630,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -682,25 +682,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0800', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -709,9 +709,9 @@ describe('audioCapturerChange', function () { 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); - var clientUid = AudioCapturerChangeInfoArray[i].clientUid; - var capFlags = AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags; - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -762,25 +762,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ON_CAPTURER_CHANGE_0900', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -790,12 +790,12 @@ describe('audioCapturerChange', function () { console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); @@ -846,26 +846,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_OFF_CAPTURER_CHANGE_0100', 1, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = true; + let resultFlag = true; - var audioCap; + let audioCap; audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { @@ -923,25 +923,25 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_OFF_CAPTURER_CHANGE_0200', 1, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = true; - var audioCap; + let resultFlag = true; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -1007,25 +1007,25 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_OFF_CAPTURER_CHANGE_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = true; - var audioCap; + let resultFlag = true; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -1098,25 +1098,25 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_OFF_CAPTURER_CHANGE_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = true; - var audioCap; + let resultFlag = true; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -1188,26 +1188,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_OFF_CAPTURER_CHANGE_0500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = true; + let resultFlag = true; - var audioCap; + let audioCap; audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) => { for (let i = 0; i < AudioCapturerChangeInfoArray.length; i++) { @@ -1218,12 +1218,12 @@ describe('audioCapturerChange', function () { console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); @@ -1272,25 +1272,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_GET_CAPTURER_CHANGE_PROMISE_0100', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -1331,7 +1331,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -1377,26 +1377,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_PROMISE_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -1446,7 +1446,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -1493,26 +1493,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_PROMISE_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -1569,7 +1569,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -1615,25 +1615,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_PROMISE_0400', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -1675,12 +1675,12 @@ describe('audioCapturerChange', function () { console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); @@ -1723,25 +1723,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_CALLBACK_0100', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -1788,7 +1788,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -1834,26 +1834,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_CALLBACK_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -1909,7 +1909,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -1956,26 +1956,26 @@ describe('audioCapturerChange', function () { */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_CALLBACK_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -2038,7 +2038,7 @@ describe('audioCapturerChange', function () { 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); - var devDescriptor = AudioCapturerChangeInfoArray[i].deviceDescriptors; + 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); @@ -2084,25 +2084,25 @@ describe('audioCapturerChange', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_GET_CAPTURER_CHANGE_CALLBACK_0400', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_MIC, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } - var resultFlag = false; + 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 + ' ##'); @@ -2150,12 +2150,12 @@ describe('audioCapturerChange', function () { console.info(Tag + 'Flag ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerInfo.capturerFlags); console.info(Tag + 'State for ' + i + 'is:' + AudioCapturerChangeInfoArray[i].capturerState); for (let j = 0; j < AudioCapturerChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioCapturerChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); diff --git a/multimedia/audio/audio_js_standard/AudioEventManagement/Test.json b/multimedia/audio/audio_js_standard/AudioEventManagement/Test.json index 3133063d89f2bf15c783627fb4c808326ae4c369..4a214ead0f269411bdce0a374dda9c4fa1605cfd 100644 --- a/multimedia/audio/audio_js_standard/AudioEventManagement/Test.json +++ b/multimedia/audio/audio_js_standard/AudioEventManagement/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "1500000", "package": "ohos.acts.multimedia.audio.audioeventmanagement", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js b/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js index e0b46a0aca9d82487c317aa17d92dceb157a7139..0dd54c2763834c25c8292ddad6e7568d170180c4 100644 --- a/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js +++ b/multimedia/audio/audio_js_standard/AudioEventManagement/src/main/js/test/AudioEventManagement.test.js @@ -19,8 +19,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from describe('audioEventManagement', function () { console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); let audioManager = null; - var deviceRoleValue = null; - var deviceTypeValue = null; + let deviceRoleValue = null; + let deviceTypeValue = null; function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -34,8 +34,8 @@ describe('audioEventManagement', function () { } } function displayDeviceProp(value, index, array) { - var devRoleName; - var devTypeName; + let devRoleName; + let devTypeName; if (value.deviceRole == 1) { devRoleName = 'INPUT_DEVICE'; } @@ -100,10 +100,8 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; - const promise = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) - promise.then(function (value) { + const PROMISE = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -116,7 +114,7 @@ describe('audioEventManagement', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -129,11 +127,8 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_OUTPUT_ENUM_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; - const promise = audioManager.getDevices(1) - promise.then(function (value) { - + const PROMISE = audioManager.getDevices(1) + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { @@ -145,7 +140,7 @@ describe('audioEventManagement', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -158,10 +153,8 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INPUT_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; - const promise = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); - promise.then(function (value) { + const PROMISE = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); if (deviceTypeValue != null && deviceRoleValue != null) { @@ -173,7 +166,7 @@ describe('audioEventManagement', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -186,10 +179,8 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INTPUT_ENUM_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; - const promise = audioManager.getDevices(2); - promise.then(function (value) { + const PROMISE = audioManager.getDevices(2); + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -202,7 +193,7 @@ describe('audioEventManagement', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -215,10 +206,8 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; - const promise = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); - promise.then(function (value) { + const PROMISE = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -231,7 +220,7 @@ describe('audioEventManagement', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -244,10 +233,8 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_ENUM_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; - const promise = audioManager.getDevices(3); - promise.then(function (value) { + const PROMISE = audioManager.getDevices(3); + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -260,7 +247,7 @@ describe('audioEventManagement', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -273,8 +260,6 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { @@ -306,8 +291,6 @@ describe('audioEventManagement', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; audioManager.getDevices(1, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { @@ -339,8 +322,6 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { @@ -373,8 +354,6 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; audioManager.getDevices(2, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { @@ -407,8 +386,6 @@ describe('audioEventManagement', function () { *@tc.level : Level 0 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); if (err) { @@ -440,8 +417,6 @@ describe('audioEventManagement', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, async function (done) { - deviceRoleValue = null; - deviceTypeValue = null; audioManager.getDevices(3, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); if (err) { @@ -756,6 +731,4 @@ describe('audioEventManagement', function () { await sleep(50); done(); }) - - }) \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/Test.json b/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/Test.json index 6268e956da954daecc69dcb9bb8cddde0b5f6952..005c59d5bcdfa3f4ac8b959977a6d9f6aeee8ae9 100644 --- a/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/Test.json +++ b/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "1500000", "package": "ohos.acts.multimedia.audio.audiorendererchangeInfo", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js b/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js index 503b80e3319b2558568fcee65e12f5ec4de81727..cdb7623dd73e50619d00f4d254e8c6c918135ecd 100644 --- a/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js +++ b/multimedia/audio/audio_js_standard/AudioRendererChangeInfo/src/main/js/test/AudioRendererChangeInfo.test.js @@ -18,21 +18,21 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from describe('audioRendererChange', function () { - var audioStreamManager; - var audioStreamManagerCB; - var Tag = "AFRenLog : "; - const audioManager = audio.getAudioManager(); + let audioStreamManager; + let audioStreamManagerCB; + let Tag = 'AFRenLog : '; + const AUDIOMANAGER = audio.getAudioManager(); console.info(Tag + 'Create AudioManger Object JS Framework'); beforeAll(async function () { - await audioManager.getStreamManager().then(async function (data) { + await AUDIOMANAGER.getStreamManager().then(async function (data) { audioStreamManager = data; console.info(Tag + 'Get AudioStream Manager : Success '); }).catch((err) => { console.info(Tag + 'Get AudioStream Manager : ERROR : ' + err.message); }); - audioManager.getStreamManager((err, data) => { + AUDIOMANAGER.getStreamManager((err, data) => { if (err) { console.error(Tag + 'Get AudioStream Manager : ERROR : ' + err.message); } @@ -72,26 +72,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -102,7 +102,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -154,27 +154,27 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -194,7 +194,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -252,27 +252,27 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -298,7 +298,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -350,27 +350,27 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -402,7 +402,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -447,27 +447,27 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -493,7 +493,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -550,26 +550,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -580,7 +580,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -631,26 +631,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -661,7 +661,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -712,26 +712,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -742,7 +742,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -793,26 +793,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_0900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -823,7 +823,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -874,26 +874,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -904,7 +904,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -956,26 +956,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -986,7 +986,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1038,26 +1038,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1068,7 +1068,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1120,26 +1120,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1150,7 +1150,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1202,26 +1202,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1232,7 +1232,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1284,26 +1284,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1314,7 +1314,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1365,26 +1365,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1395,7 +1395,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1446,26 +1446,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1476,9 +1476,9 @@ describe('audioRendererChange', function () { 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); - var clientUid = AudioRendererChangeInfoArray[i].clientUid; - var renFlags = AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags; - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -1530,26 +1530,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_ON_RENDERER_CHANGE_1800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; audioStreamManagerCB.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1561,12 +1561,12 @@ describe('audioRendererChange', function () { console.info(Tag + 'Flag ' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags); console.info(Tag + 'State for ' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererState); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); @@ -1617,26 +1617,26 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_OFF_RENDERER_CHANGE_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_32000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; - var audioRen; + let resultFlag = true; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -1694,25 +1694,25 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_OFF_RENDERER_CHANGE_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_96000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_ASSISTANT, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; - var audioRen; + let resultFlag = true; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -1777,25 +1777,25 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_OFF_RENDERER_CHANGE_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; - var audioRen; + let resultFlag = true; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -1867,26 +1867,26 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_OFF_RENDERER_CHANGE_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_8000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; - var audioRen; + let resultFlag = true; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -1958,26 +1958,26 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_OFF_RENDERER_CHANGE_0500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_8000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; - var audioRen; + let resultFlag = true; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -2056,26 +2056,26 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_OFF_RENDERER_CHANGE_0600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_32000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; - var audioRen; + let resultFlag = true; + let audioRen; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { @@ -2087,12 +2087,12 @@ describe('audioRendererChange', function () { console.info(Tag + 'Flag ' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags); console.info(Tag + 'State for ' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererState); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); @@ -2140,26 +2140,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_PROMISE_0100', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { console.info(Tag + '## RendererChange on is called for ' + i + ' ##'); @@ -2202,7 +2202,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -2248,27 +2248,27 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_PROMISE_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioCap = data; @@ -2320,7 +2320,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -2367,27 +2367,27 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_PROMISE_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioCap = data; @@ -2446,7 +2446,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -2493,27 +2493,27 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_PROMISE_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -2572,7 +2572,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -2623,26 +2623,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_PROMISE_0500', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { console.info(Tag + '## RendererChange on is called for ' + i + ' ##'); @@ -2686,12 +2686,12 @@ describe('audioRendererChange', function () { console.info(Tag + '' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags); console.info(Tag + 'State for ' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererState); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); @@ -2734,26 +2734,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_CALLBACK_0100', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { console.info(Tag + '## RendererChange on is called for ' + i + ' ##'); @@ -2802,7 +2802,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -2848,27 +2848,27 @@ describe('audioRendererChange', function () { */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_CALLBACK_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioCap = data; @@ -2926,7 +2926,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -2972,27 +2972,27 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_CALLBACK_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioCap; + let audioCap; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioCap = data; @@ -3057,7 +3057,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -3103,27 +3103,27 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_CALLBACK_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3188,7 +3188,7 @@ describe('audioRendererChange', function () { 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); - var devDescriptor = AudioRendererChangeInfoArray[i].deviceDescriptors; + 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); @@ -3239,26 +3239,26 @@ describe('audioRendererChange', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_GET_RENDERER_CHANGE_CALLBACK_0500', 2, async function (done) { - var audioCap; - var AudioStreamInfo = { + let audioCap; + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; audioStreamManager.on('audioRendererChange', (AudioRendererChangeInfoArray) => { for (let i = 0; i < AudioRendererChangeInfoArray.length; i++) { console.info(Tag + '## RendererChange on is called for ' + i + ' ##'); @@ -3308,12 +3308,12 @@ describe('audioRendererChange', function () { console.info(Tag + '' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererInfo.rendererFlags); console.info(Tag + 'State for ' + i + ' is:' + AudioRendererChangeInfoArray[i].rendererState); for (let j = 0; j < AudioRendererChangeInfoArray[i].deviceDescriptors.length; j++) { - var Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; - var dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; - var dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; - var sRate = AudioRendererChangeInfoArray[i].deviceDescriptors[j].sampleRates[0]; - var cCount = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelCounts[0]; - var cMask = AudioRendererChangeInfoArray[i].deviceDescriptors[j].channelMasks; + let Id = AudioRendererChangeInfoArray[i].deviceDescriptors[j].id; + let dType = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceType; + let dRole = AudioRendererChangeInfoArray[i].deviceDescriptors[j].deviceRole; + 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); diff --git a/multimedia/audio/audio_js_standard/audioManager/Test.json b/multimedia/audio/audio_js_standard/audioManager/Test.json index ee10505911d57668c2b06ab3aaf5a6d0919d78ad..5c21d26eee605d67561a1c015b1a07fee19aad97 100755 --- a/multimedia/audio/audio_js_standard/audioManager/Test.json +++ b/multimedia/audio/audio_js_standard/audioManager/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "1500000", "package": "ohos.acts.multimedia.audio.audiomanager", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js index ab21048613e902d153ba82a9f59c38421db1003d..0fc5a357edda2d6b8e90a734efff0b222738f2e4 100755 --- a/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js +++ b/multimedia/audio/audio_js_standard/audioManager/src/main/js/test/AudioFramework.test.js @@ -21,22 +21,22 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from describe('audioFramework', function () { console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); let audioManager = null; - var dRValue = null; - var dTValue = null; - var devId = null; - var devName = null; - var devAddr = null; - var sRate = null; - var cCount = null; - var cMask = null; - var audioMedia = 3; - var audioRingtone = 2; - var minVol = 0; - var maxVol = 15; - var lowVol = 5; - var highVol = 14; - var outOfRangeVol = 28; - var longValue = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843'; + let dRValue = null; + let dTValue = null; + let devId = null; + let devName = null; + let devAddr = null; + let sRate = null; + let cCount = null; + let cMask = null; + let audioMedia = 3; + let audioRingtone = 2; + let minVol = 0; + let maxVol = 15; + let lowVol = 5; + let highVol = 14; + let outOfRangeVol = 28; + let longValue = '28374837458743875804735081439085918459801437584738967509184509813904850914375904790589104801843'; function getAudioManager() { audioManager = audio.getAudioManager(); if (audioManager != null) { @@ -51,8 +51,8 @@ describe('audioFramework', function () { } function displayDeviceProp(value, index, array) { - var devRoleName; - var devTypeName; + let devRoleName; + let devTypeName; if (value.deviceRole == 1) { devRoleName = 'INPUT_DEVICE'; } @@ -136,38 +136,38 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOMANAGER_0200', 1, async function (done) { - const audioManager1 = audio.getAudioManager(); - const audioManager2 = audio.getAudioManager(); - const audioManager3 = audio.getAudioManager(); - const audioManager4 = audio.getAudioManager(); - const audioManager5 = audio.getAudioManager(); - const audioManager6 = audio.getAudioManager(); - const audioManager7 = audio.getAudioManager(); - const audioManager8 = audio.getAudioManager(); - const audioManager9 = audio.getAudioManager(); - const audioManager10 = audio.getAudioManager(); - const promise = audioManager.setVolume(audioMedia, lowVol); - promise.then(function () { + const AUDIOMANAGER1 = audio.getAudioManager(); + const AUDIOMANAGER2 = audio.getAudioManager(); + const AUDIOMANAGER3 = audio.getAudioManager(); + const AUDIOMANAGER4 = audio.getAudioManager(); + const AUDIOMANAGER5 = audio.getAudioManager(); + const AUDIOMANAGER6 = audio.getAudioManager(); + const AUDIOMANAGER7 = audio.getAudioManager(); + const AUDIOMANAGER8 = audio.getAudioManager(); + const AUDIOMANAGER9 = audio.getAudioManager(); + const AUDIOMANAGER10 = audio.getAudioManager(); + const PROMISE = audioManager.setVolume(audioMedia, lowVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Media setVolume promise: successful'); - audioManager1.setVolume(audioMedia, highVol); + AUDIOMANAGER1.setVolume(audioMedia, highVol); console.info('AudioFrameworkTest:audioManager1 : Media setVolume promise: successful'); - audioManager2.setVolume(audioMedia, highVol); + AUDIOMANAGER2.setVolume(audioMedia, highVol); console.info('AudioFrameworkTest:audioManager2 : Media setVolume promise: successful'); - audioManager3.setVolume(audioMedia, highVol); + AUDIOMANAGER3.setVolume(audioMedia, highVol); console.info('AudioFrameworkTest:audioManager3 : Media setVolume promise: successful'); - audioManager4.setVolume(audioMedia, lowVol); + AUDIOMANAGER4.setVolume(audioMedia, lowVol); console.info('AudioFrameworkTest:audioManager4 : Media setVolume promise: successful'); - audioManager5.setVolume(audioMedia, highVol); + AUDIOMANAGER5.setVolume(audioMedia, highVol); console.info('AudioFrameworkTest:audioManager5 : Media setVolume promise: successful'); - audioManager6.setVolume(audioMedia, lowVol); + AUDIOMANAGER6.setVolume(audioMedia, lowVol); console.info('AudioFrameworkTest:audioManager6 : Media setVolume promise: successful'); - audioManager7.setVolume(audioMedia, highVol); + AUDIOMANAGER7.setVolume(audioMedia, highVol); console.info('AudioFrameworkTest:audioManager7 : Media setVolume promise: successful'); - audioManager8.setVolume(audioMedia, lowVol); + AUDIOMANAGER8.setVolume(audioMedia, lowVol); console.info('AudioFrameworkTest:audioManager8 : Media setVolume promise: successful'); - audioManager9.setVolume(audioMedia, highVol); + AUDIOMANAGER9.setVolume(audioMedia, highVol); console.info('AudioFrameworkTest:audioManager9 : Media setVolume promise: successful'); - audioManager10.setVolume(audioMedia, lowVol); + AUDIOMANAGER10.setVolume(audioMedia, lowVol); console.info('AudioFrameworkTest:audioManager10 : Media setVolume promise: successful'); audioManager.getVolume(audioMedia).then(function (data) { if (data == lowVol) { @@ -182,7 +182,7 @@ describe('audioFramework', function () { console.info('AudioFrameworkTest: Media getVolume Promise: Error :' + err.message); }); }); - await promise; + await PROMISE; done(); }) @@ -195,8 +195,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0100', 1, async function (done) { - const promise = audioManager.setVolume(audioMedia, lowVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audioMedia, lowVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Media setVolume promise: successful'); audioManager.getVolume(audioMedia).then(function (data) { if (data == lowVol) { @@ -209,7 +209,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -222,8 +222,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0200', 2, async function (done) { - const promise = audioManager.setVolume(audioMedia, maxVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audioMedia, maxVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Media setVolume promise: successful'); audioManager.getVolume(audioMedia).then(function (data) { if (data == maxVol) { @@ -236,7 +236,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -249,8 +249,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0300', 2, async function (done) { - const promise = audioManager.setVolume(audioMedia, minVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audioMedia, minVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Media setVolume promise: successful'); audioManager.getVolume(audioMedia).then(function (data) { @@ -264,7 +264,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -427,8 +427,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_0900', 2, async function (done) { - const promise = audioManager.setVolume(audioRingtone, lowVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audioRingtone, lowVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); audioManager.getVolume(audioRingtone).then(function (data) { if (data == lowVol) { @@ -441,7 +441,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -454,8 +454,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1000', 2, async function (done) { - const promise = audioManager.setVolume(audioRingtone, maxVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audioRingtone, maxVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); audioManager.getVolume(audioRingtone).then(function (data) { if (data == maxVol) { @@ -468,7 +468,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -481,8 +481,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_1100', 2, async function (done) { - const promise = audioManager.setVolume(audioRingtone, minVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audioRingtone, minVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Ringtone setVolume promise: successful'); audioManager.getVolume(audioRingtone).then(function (data) { if (data == minVol) { @@ -495,7 +495,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -747,8 +747,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2100', 2, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); + PROMISE.then(function () { audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == lowVol) { console.info('AudioFrameworkTest: Media getVolume Promise: ENAME : PASS :' + data); @@ -760,7 +760,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -809,8 +809,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2300', 2, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == highVol) { @@ -823,7 +823,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -872,8 +872,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2500', 2, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); + PROMISE.then(function () { audioManager.setVolume(audio.AudioVolumeType.RINGTONE, maxVol); audioManager.getVolume(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == lowVol) { @@ -886,7 +886,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -936,8 +936,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETVOLUME_2700', 2, async function (done) { - const promise = audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); - promise.then(function () { + const PROMISE = audioManager.setVolume(audio.AudioVolumeType.RINGTONE, highVol); + PROMISE.then(function () { console.info('AudioFrameworkTest: Ringtone setVolume promise: ENAME: successful'); audioManager.setVolume(audio.AudioVolumeType.MEDIA, lowVol); audioManager.getVolume(audio.AudioVolumeType.RINGTONE).then(function (data) { @@ -951,7 +951,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -1001,8 +1001,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0100', 1, async function (done) { - const promise = audioManager.getMaxVolume(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.getMaxVolume(audioMedia); + PROMISE.then(function (data) { if (data == maxVol) { console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1012,7 +1012,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1051,8 +1051,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0300', 2, async function (done) { - const promise = audioManager.getMaxVolume(audioRingtone); - promise.then(function (data) { + const PROMISE = audioManager.getMaxVolume(audioRingtone); + PROMISE.then(function (data) { if (data == maxVol) { console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1062,7 +1062,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1102,8 +1102,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0500', 2, async function (done) { audioManager.setVolume(audioRingtone, lowVol); - const promise = audioManager.getMaxVolume(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.getMaxVolume(audioMedia); + PROMISE.then(function (data) { if (data == maxVol) { console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1113,7 +1113,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1127,8 +1127,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0600', 2, async function (done) { audioManager.setVolume(audioMedia, lowVol); - const promise = audioManager.getMaxVolume(audioRingtone); - promise.then(function (data) { + const PROMISE = audioManager.getMaxVolume(audioRingtone); + PROMISE.then(function (data) { if (data == maxVol) { console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1139,7 +1139,7 @@ describe('audioFramework', function () { } }); - await promise; + await PROMISE; done(); }) @@ -1208,8 +1208,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_0900', 2, async function (done) { audioManager.setVolume(audioMedia, lowVol); - const promise = audioManager.getMaxVolume(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.getMaxVolume(audioMedia); + PROMISE.then(function (data) { if (data == maxVol) { console.info('AudioFrameworkTest: Media getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1219,7 +1219,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1233,8 +1233,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMAXVOLUME_1000', 2, async function (done) { audioManager.setVolume(audioRingtone, lowVol); - const promise = audioManager.getMaxVolume(audioRingtone); - promise.then(function (data) { + const PROMISE = audioManager.getMaxVolume(audioRingtone); + PROMISE.then(function (data) { if (data == maxVol) { console.info('AudioFrameworkTest: Ringtone getMaxVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1244,7 +1244,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1311,8 +1311,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0100', 1, async function (done) { - const promise = audioManager.getMinVolume(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.getMinVolume(audioMedia); + PROMISE.then(function (data) { if (data == minVol) { console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1322,7 +1322,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1361,8 +1361,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0300', 2, async function (done) { - const promise = audioManager.getMinVolume(audioRingtone); - promise.then(function (data) { + const PROMISE = audioManager.getMinVolume(audioRingtone); + PROMISE.then(function (data) { if (data == minVol) { console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1373,7 +1373,7 @@ describe('audioFramework', function () { } }); - await promise; + await PROMISE; done(); }) @@ -1413,8 +1413,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0500', 2, async function (done) { audioManager.setVolume(audioRingtone, lowVol); - const promise = audioManager.getMinVolume(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.getMinVolume(audioMedia); + PROMISE.then(function (data) { if (data == minVol) { console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1424,7 +1424,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1465,8 +1465,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0700', 2, async function (done) { audioManager.setVolume(audioMedia, highVol); - const promise = audioManager.getMinVolume(audioRingtone); - promise.then(function (data) { + const PROMISE = audioManager.getMinVolume(audioRingtone); + PROMISE.then(function (data) { if (data == minVol) { console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1476,7 +1476,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1517,8 +1517,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_0900', 2, async function (done) { audioManager.setVolume(audioMedia, lowVol); - const promise = audioManager.getMinVolume(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.getMinVolume(audioMedia); + PROMISE.then(function (data) { if (data == minVol) { console.info('AudioFrameworkTest: Media getMinVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1528,7 +1528,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1569,8 +1569,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETMINVOLUME_1100', 2, async function (done) { audioManager.setVolume(audioRingtone, lowVol); - const promise = audioManager.getMinVolume(audioRingtone) - promise.then(function (data) { + const PROMISE = audioManager.getMinVolume(audioRingtone) + PROMISE.then(function (data) { if (data == minVol) { console.info('AudioFrameworkTest: Ringtone getMinVolume promise : PASS:' + data); expect(true).assertTrue(); @@ -1580,7 +1580,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1620,17 +1620,9 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0100', 1, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; - const promise = audioManager.getDevices(1); + const PROMISE = audioManager.getDevices(1); // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG - promise.then(function (value) { + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); if (dTValue != null && dRValue != null && devId > 0 && sRate != null && cCount != null && cMask != null) { @@ -1642,7 +1634,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1655,17 +1647,9 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0200', 1, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; - const promise = audioManager.getDevices(2); + const PROMISE = audioManager.getDevices(2); // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG - promise.then(function (value) { + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -1678,7 +1662,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1691,17 +1675,9 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0300', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; - const promise = audioManager.getDevices(3); + const PROMISE = audioManager.getDevices(3); // Getting all devies connected 3 = ALL_DEVICES_FLAG - promise.then(function (value) { + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -1715,7 +1691,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) /** @@ -1727,14 +1703,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0400', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getDevices(1, (err, value) => { // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); @@ -1769,14 +1737,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0500', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getDevices(2, (err, value) => { // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG @@ -1812,14 +1772,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0600', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getDevices(3, (err, value) => { // Getting all devies connected 3 = ALL_DEVICES_FLAG @@ -1855,16 +1807,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0700', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; - const promise = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) - promise.then(function (value) { + const PROMISE = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG) + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -1877,7 +1821,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1890,16 +1834,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0800', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; - const promise = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); - promise.then(function (value) { + const PROMISE = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG); + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -1912,7 +1848,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1925,16 +1861,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0900', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; - const promise = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); - promise.then(function (value) { + const PROMISE = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG); + PROMISE.then(function (value) { console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); value.forEach(displayDeviceProp); @@ -1947,7 +1875,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -1960,14 +1888,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1000', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); if (err) { @@ -1999,14 +1919,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1100', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); if (err) { @@ -2039,14 +1951,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_1200', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); if (err) { @@ -2078,9 +1982,9 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0100', 1, async function (done) { - const promise = audioManager.setRingerMode(2); + const PROMISE = audioManager.setRingerMode(2); // Setting Ringtone Mode to Normal ENUM 2 = RINGER_MODE_NORMAL - promise.then(function () { + PROMISE.then(function () { console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL'); audioManager.getRingerMode().then(function (value) { if (value == 2) { @@ -2093,7 +1997,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -2106,9 +2010,9 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0200', 1, async function (done) { - const promise = audioManager.setRingerMode(0); + const PROMISE = audioManager.setRingerMode(0); // Setting Ringtone Mode to Silent ENUM 0 = RINGER_MODE_SILENT - promise.then(function () { + PROMISE.then(function () { console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT'); audioManager.getRingerMode().then(function (value) { if (value == 0) { @@ -2121,7 +2025,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -2134,9 +2038,9 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0300', 2, async function (done) { - const promise = audioManager.setRingerMode(1); + const PROMISE = audioManager.setRingerMode(1); // Setting Ringtone Mode to Vibration ENUM 1 = RINGER_MODE_VIBRATE - promise.then(function () { + PROMISE.then(function () { console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE'); audioManager.getRingerMode().then(function (value) { if (value == 1) { @@ -2149,7 +2053,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -2275,8 +2179,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0700', 2, async function (done) { - const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL); - promise.then(function () { + const PROMISE = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL); + PROMISE.then(function () { console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_NORMAL'); audioManager.getRingerMode().then(function (value) { if (value == audio.AudioRingMode.RINGER_MODE_NORMAL) { @@ -2289,7 +2193,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -2302,8 +2206,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0800', 2, async function (done) { - const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT); - promise.then(function () { + const PROMISE = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_SILENT); + PROMISE.then(function () { console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_SILENT'); audioManager.getRingerMode().then(function (value) { if (value == audio.AudioRingMode.RINGER_MODE_SILENT) { @@ -2316,7 +2220,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -2329,8 +2233,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETRINGERMODE_0900', 2, async function (done) { - const promise = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE); - promise.then(function () { + const PROMISE = audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_VIBRATE); + PROMISE.then(function () { console.info('AudioFrameworkTest: Promise: setRingerMode RINGER_MODE_VIBRATE'); audioManager.getRingerMode().then(function (value) { if (value == audio.AudioRingMode.RINGER_MODE_VIBRATE) { @@ -2343,7 +2247,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -3463,8 +3367,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0100', 1, async function (done) { console.log('AudioFrameworkTest: Promise : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(audioMedia); - promise.then(function (data) { + const PROMISE = audioManager.isActive(audioMedia); + PROMISE.then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: isActive: Media: TRUE: PASS:' + data); expect(true).assertTrue(); @@ -3474,7 +3378,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -3515,8 +3419,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0300', 2, async function (done) { console.log('AudioFrameworkTest: Promise : isActive Ringtone: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(audioRingtone); - promise.then(function (data) { + const PROMISE = audioManager.isActive(audioRingtone); + PROMISE.then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: isActive: Ringtone: TRUE: PASS:' + data); expect(true).assertTrue(); @@ -3526,7 +3430,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -3567,8 +3471,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0500', 2, async function (done) { console.log('AudioFrameworkTest: Promise : isActive Media: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(audio.AudioVolumeType.MEDIA); - promise.then(function (data) { + const PROMISE = audioManager.isActive(audio.AudioVolumeType.MEDIA); + PROMISE.then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: isActive: Media: ENAME: TRUE: PASS:' + data); expect(true).assertTrue(); @@ -3578,7 +3482,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -3619,8 +3523,8 @@ describe('audioFramework', function () { */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ISACTIVE_0700', 2, async function (done) { console.log('AudioFrameworkTest: Promise : isActive Ringtone: ENAME: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS'); - const promise = audioManager.isActive(audio.AudioVolumeType.RINGTONE); - promise.then(function (data) { + const PROMISE = audioManager.isActive(audio.AudioVolumeType.RINGTONE); + PROMISE.then(function (data) { if (data == false) { console.log('AudioFrameworkTest: Promise: isActive: Ringtone: ENAME: TRUE: PASS:' + data); expect(true).assertTrue(); @@ -3630,7 +3534,7 @@ describe('audioFramework', function () { expect(false).assertTrue(); } }); - await promise; + await PROMISE; done(); }) @@ -3929,8 +3833,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0100', 1, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '8 bit') { @@ -3943,7 +3847,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -3956,8 +3860,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0200', 1, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '4800') { @@ -3970,7 +3874,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -3983,8 +3887,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0300', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == longValue) { @@ -3997,7 +3901,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4010,8 +3914,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0400', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.000000234324324324'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.000000234324324324'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '10.000000234324324324') { @@ -4024,7 +3928,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4037,8 +3941,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0500', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == 'PPNumber') { @@ -4051,7 +3955,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4064,8 +3968,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_SETAUDIOPARAMETER_0600', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '[]\:";<>?,./~!@#$%^*()_+-={}|') { @@ -4078,7 +3982,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4303,8 +4207,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0100', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '8 bit'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '8 bit') { @@ -4317,7 +4221,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4330,8 +4234,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0200', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '4800'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '4800') { @@ -4344,7 +4248,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4357,8 +4261,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0300', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', longValue); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == longValue) { @@ -4371,7 +4275,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4384,8 +4288,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0400', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.0000000000234'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '10.0000000000234'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '10.0000000000234') { @@ -4398,7 +4302,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4411,8 +4315,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0500', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', 'PPNumber'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == 'PPNumber') { @@ -4425,7 +4329,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4438,8 +4342,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETAUDIOPARAMETER_0600', 2, async function (done) { - const promise = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|'); - promise.then(function () { + const PROMISE = audioManager.setAudioParameter('VOICE_PHONE_STATUS', '[]\:";<>?,./~!@#$%^*()_+-={}|'); + PROMISE.then(function () { console.info('AudioFrameworkTest: Audio Parameter Test: Promise : setAudioParameter'); audioManager.getAudioParameter('VOICE_PHONE_STATUS').then(function (value) { if (value == '[]\:";<>?,./~!@#$%^*()_+-={}|') { @@ -4452,7 +4356,7 @@ describe('audioFramework', function () { } }); }); - await promise; + await PROMISE; done(); }) @@ -4671,11 +4575,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0100', 1, async function (done) { - audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); - switch (VolumeEvent.volumeType) { case audio.AudioVolumeType.MEDIA: console.info('AudioFrameworkTest: Audio Volume Type : MEDIA'); @@ -4707,11 +4608,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0200', 1, async function (done) { - audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); - switch (VolumeEvent.volumeType) { case audio.AudioVolumeType.RINGTONE: console.info('AudioFrameworkTest: Audio Volume Type : RINGTONE'); @@ -4743,11 +4641,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0300', 2, async function (done) { - audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); - switch (VolumeEvent.volumeType) { case audio.AudioVolumeType.VOICE_CALL: console.info('AudioFrameworkTest: Audio Volume Type : VOICE_CALL'); @@ -4779,11 +4674,8 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_ONVOLUMECHANGE_0400', 2, async function (done) { - audioManager.on('volumeChange', (VolumeEvent) => { - console.log('AudioFrameworkTest: Volume Change Event is called'); - switch (VolumeEvent.volumeType) { case audio.AudioVolumeType.VOICE_ASSISTANT: console.info('AudioFrameworkTest: Audio Volume Type : VOICE_ASSISTANT'); @@ -4815,11 +4707,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0100', 1, async function (done) { - audioManager.on('ringerModeChange', (ringerMode) => { - console.log('AudioFrameworkTest: RingerModeChange is called'); - switch (ringerMode) { case audio.AudioRingMode.RINGER_MODE_SILENT: console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_SILENT : ' + ringerMode); @@ -4844,11 +4733,8 @@ describe('audioFramework', function () { *@tc.level : Level 1 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0200', 1, async function (done) { - audioManager.on('ringerModeChange', (ringerMode) => { - console.log('AudioFrameworkTest: RingerModeChange is called'); - switch (ringerMode) { case audio.AudioRingMode.RINGER_MODE_VIBRATE: console.info('AudioFrameworkTest: Ringer Mode Changed to : RINGER_MODE_VIBRATE : ' + ringerMode); @@ -4873,7 +4759,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_MANAGER_RINGERMODECHANGE_0300', 2, async function (done) { - audioManager.on('ringerModeChange', (ringerMode) => { console.log('AudioFrameworkTest: RingerModeChange is called'); switch (ringerMode) { @@ -5144,14 +5029,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0100', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(1, (err, value) => { // Getting all Output devices Enumb 1 = OUTPUT_DEVICES_FLAG @@ -5188,14 +5065,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0200', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(2, (err, value) => { // Getting all Input Devices ENUM 2 = INPUT_DEVICES_FLAG @@ -5233,14 +5102,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0300', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(3, (err, value) => { // Getting all devies connected 3 = ALL_DEVICES_FLAG @@ -5278,14 +5139,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0400', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); @@ -5319,14 +5172,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0500', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); @@ -5361,14 +5206,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0600', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); AudioRoutingManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); @@ -5402,14 +5239,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0700', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; let AudioRoutingManager = await audioManager.getRoutingManager(); let value = await AudioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG); console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); @@ -5435,14 +5264,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getRoutingManager(async (err, AudioRoutingManager) => { if (err) { console.error(`AudioFrameworkTest: Callback: failed to get RoutingManager ${err.message}`); @@ -5475,14 +5296,6 @@ describe('audioFramework', function () { *@tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900', 2, async function (done) { - dRValue = null; - dTValue = null; - devId = null; - devName = null; - devAddr = null; - sRate = null; - cCount = null; - cMask = null; audioManager.getRoutingManager(async (err, AudioRoutingManager) => { if (err) { console.error(`AudioFrameworkTest:Callback:failed to get RoutingManager ${err.message}`); diff --git a/multimedia/audio/audio_js_standard/audioRenderer/Test.json b/multimedia/audio/audio_js_standard/audioRenderer/Test.json index 220f903ffa57b77a8973af94f23167b4100a2496..c35bc3a0613d4628292e6dc36a4df51e6fbecaa6 100644 --- a/multimedia/audio/audio_js_standard/audioRenderer/Test.json +++ b/multimedia/audio/audio_js_standard/audioRenderer/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "1500000", "package": "ohos.acts.multimedia.audio.audiorenderer", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js b/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js index 111de6d5d023affcda3f2f2959374707d01b9e32..e81dbf72055f1a4b2ef6502026941909456cc3a4 100644 --- a/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js +++ b/multimedia/audio/audio_js_standard/audioRenderer/src/main/js/test/AudioRenderer.test.js @@ -23,7 +23,7 @@ describe('audioRenderer', function () { let fdRead; let readPath; - const audioManager = audio.getAudioManager(); + const AUDIOMANAGER = audio.getAudioManager(); console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); let fdPath; let filePath; @@ -82,10 +82,10 @@ describe('audioRenderer', function () { } async function playbackPromise(AudioRendererOptions, pathName, AudioScene) { - var resultFlag = 'new'; + let resultFlag = 'new'; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -154,7 +154,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -182,7 +182,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: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(async function (data) { console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -231,10 +231,10 @@ describe('audioRenderer', function () { } async function playbackPromise_93(AudioRendererOptions, pathName, AudioScene) { - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -303,7 +303,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -323,7 +323,7 @@ describe('audioRenderer', function () { } console.info('AudioFrameworkRenderLog: Renderer after read'); - //var gettime = audioTimeMiddle-audioTimeStart; + //let gettime = audioTimeMiddle-audioTimeStart; if (audioTimeStart != 0) { console.info('AudioFrameworkRenderLog: getAudioTime : PASS : ' + audioTimeStart); } @@ -361,10 +361,10 @@ describe('audioRenderer', function () { } async function playbackPromise_94(AudioRendererOptions, pathName, AudioScene) { - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -423,7 +423,7 @@ describe('audioRenderer', function () { //console.info('AudioFrameworkRenderLog: Current Time in NANOSeconds : '+audioTime); console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -435,7 +435,7 @@ describe('audioRenderer', function () { totalSize = totalSize - 44; console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); let rlen = 0; - var gettime = 0; + let gettime = 0; while (rlen < totalSize / 4) { let buf = new ArrayBuffer(bufferSize); rlen += ss.readSync(buf); @@ -488,10 +488,10 @@ describe('audioRenderer', function () { } async function playbackPromise_95(AudioRendererOptions, pathName, AudioScene) { - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -547,7 +547,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -613,8 +613,8 @@ describe('audioRenderer', function () { } async function playbackPromise_102(AudioRendererOptions, pathName) { - var resultFlag = false; - var audioRen; + let resultFlag = false; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -651,7 +651,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -707,8 +707,8 @@ describe('audioRenderer', function () { } async function playbackPromise_103(AudioRendererOptions, pathName) { - var resultFlag = false; - var audioRen; + let resultFlag = false; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -749,7 +749,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -802,8 +802,8 @@ describe('audioRenderer', function () { } async function playbackPromise_104(AudioRendererOptions, pathName) { - var resultFlag = false; - var audioRen; + let resultFlag = false; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -844,7 +844,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -897,8 +897,8 @@ describe('audioRenderer', function () { } async function playbackPromise_105(AudioRendererOptions, pathName) { - var resultFlag = false; - var audioRen; + let resultFlag = false; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -936,7 +936,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -989,8 +989,8 @@ describe('audioRenderer', function () { } async function playbackPromise_106(AudioRendererOptions, pathName) { - var resultFlag = false; - var audioRen; + let resultFlag = false; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -1034,7 +1034,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -1087,8 +1087,8 @@ describe('audioRenderer', function () { } async function playbackPromise_107(AudioRendererOptions, pathName) { - var resultFlag = false; - var audioRen; + let resultFlag = false; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -1129,7 +1129,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -1182,10 +1182,10 @@ describe('audioRenderer', function () { } async function playbackPromise_113(AudioRendererOptions, pathName) { - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); @@ -1227,7 +1227,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -1245,7 +1245,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await audioManager.getAudioScene().then(async function (data) { + await AUDIOMANAGER.getAudioScene().then(async function (data) { console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -1311,11 +1311,11 @@ describe('audioRenderer', function () { async function playbackCB(AudioRendererOptions, pathName) { - var resultFlag = 'new'; + let resultFlag = 'new'; console.info('AudioFrameworkRenderLog: CALLBACK : Audio Playback Function'); - var audioRen; + let audioRen; audio.createAudioRenderer(AudioRendererOptions, (err, data) => { if (err) { @@ -1356,7 +1356,7 @@ describe('audioRenderer', function () { } console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var samplingRate; + let samplingRate; audioRen.getStreamInfo(async (err, audioParamsGet) => { await sleep(100); if (err) { @@ -1396,7 +1396,7 @@ describe('audioRenderer', function () { return resultFlag; } - var bufferSize; + let bufferSize; await audioRen.getBufferSize((err, data) => { if (err) { console.info('AudioFrameworkRenderLog: getBufferSize :ERROR : ' + err.message); @@ -1425,8 +1425,8 @@ describe('audioRenderer', function () { let rlen = 0; console.info('AudioFrameworkRenderLog: File size : Removing header: ' + totalSize); await sleep(100); - // var waitTime = (totalSize/88200); - var waitTime; + // let waitTime = (totalSize/88200); + let waitTime; switch (samplingRate) { case 44100: waitTime = 45; @@ -1548,27 +1548,27 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-1C-44100-2SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1586,27 +1586,27 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-24000-3SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise_93(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise_93(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1625,27 +1625,27 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-24000-3SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise_94(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise_94(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1663,27 +1663,27 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-24000-3SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise_95(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise_95(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1700,28 +1700,28 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise_102(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_102(AudioRendererOptions, filePath); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1739,27 +1739,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise_103(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_103(AudioRendererOptions, filePath); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1777,28 +1777,28 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); - var resultFlag = await playbackPromise_104(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_104(AudioRendererOptions, filePath); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1816,26 +1816,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); - var resultFlag = await playbackPromise_105(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_105(AudioRendererOptions, filePath); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1853,27 +1853,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_0900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); - var resultFlag = await playbackPromise_106(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_106(AudioRendererOptions, filePath); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1891,28 +1891,28 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); - var resultFlag = await playbackPromise_107(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_107(AudioRendererOptions, filePath); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -1929,27 +1929,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_8000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-1C-8000-2SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -1967,27 +1967,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_32000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-1C-32000-1SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); @@ -2005,27 +2005,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_64000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-1C-64000-3SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -2042,27 +2042,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_96000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-1C-96000-4SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -2079,27 +2079,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_11025, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-11025-1SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -2116,27 +2116,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_12000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-12000-2SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -2153,27 +2153,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -2190,30 +2190,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2238,30 +2238,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_1900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2285,30 +2285,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2332,30 +2332,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2380,30 +2380,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); } @@ -2427,30 +2427,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); } @@ -2474,30 +2474,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2521,30 +2521,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.VOICE_ASSISTANT).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.VOICE_ASSISTANT).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive VOICE_ASSISTANT: PASS :' + data); } @@ -2568,30 +2568,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2616,30 +2616,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2663,30 +2663,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); } @@ -2710,30 +2710,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_2900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); } @@ -2757,30 +2757,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2804,30 +2804,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.VOICE_CALL).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.VOICE_CALL).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive VOICE_CALL: PASS :' + data); } @@ -2851,30 +2851,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2898,30 +2898,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2945,30 +2945,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -2992,30 +2992,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -3039,30 +3039,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -3087,30 +3087,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -3135,30 +3135,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive RENGITONE: PASS :' + data); } @@ -3183,30 +3183,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_3900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -3231,30 +3231,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.MEDIA).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive Media: PASS :' + data); } @@ -3278,30 +3278,30 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; readPath = 'StarWars10s-2C-48000-4SW.wav' await getFdRead(readPath, done); playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_DEFAULT); await sleep(2000); - audioManager.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { + AUDIOMANAGER.isActive(audio.AudioVolumeType.RINGTONE).then(function (data) { if (data == true) { console.log('AudioFrameworkTest: Promise : isActive RINGTONE: PASS :' + data); } @@ -3326,27 +3326,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3414,27 +3414,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3504,27 +3504,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3594,27 +3594,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3684,27 +3684,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3774,27 +3774,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_UNKNOWN, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3864,27 +3864,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -3954,27 +3954,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_4900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4044,27 +4044,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4134,27 +4134,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4224,27 +4224,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4314,27 +4314,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4404,27 +4404,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4494,27 +4494,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4584,27 +4584,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4674,27 +4674,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4764,27 +4764,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4854,27 +4854,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_5900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -4944,27 +4944,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_UNKNOWN, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5034,27 +5034,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5124,27 +5124,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5214,27 +5214,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MOVIE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5304,27 +5304,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SONIFICATION, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5394,27 +5394,27 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5484,26 +5484,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5556,26 +5556,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5643,26 +5643,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5732,26 +5732,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_6900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5822,26 +5822,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = true; + let resultFlag = true; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -5921,33 +5921,33 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - // var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + // let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); - var AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; + let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -6006,7 +6006,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -6024,7 +6024,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await audioManager.getAudioScene().then(async function (data) { + await AUDIOMANAGER.getAudioScene().then(async function (data) { console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -6100,33 +6100,33 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7200', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-24000-3SW.wav' await getFdRead(readPath, done); - var AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; + let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -6185,7 +6185,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -6203,7 +6203,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await audioManager.getAudioScene().then(async function (data) { + await AUDIOMANAGER.getAudioScene().then(async function (data) { console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -6278,33 +6278,33 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7300', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-1C-44100-2SW.wav' await getFdRead(readPath, done); - var AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; + let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); @@ -6335,7 +6335,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -6353,7 +6353,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); await audioRen.write(buf); if (rlen > (totalSize / 8)) { - await audioManager.getAudioScene().then(async function (data) { + await AUDIOMANAGER.getAudioScene().then(async function (data) { console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -6434,33 +6434,33 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7400', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_96000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - // var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + // let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-1C-96000-4SW.wav' await getFdRead(readPath, done); - var AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; + let AudioScene = audio.AudioScene.AUDIO_SCENE_DEFAULT; - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -6520,7 +6520,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize = await audioRen.getBufferSize(); + let bufferSize = await audioRen.getBufferSize(); console.info('AudioFrameworkRenderLog: buffer size: ' + bufferSize); let ss = fileio.fdopenStreamSync(fdRead, 'r'); @@ -6538,7 +6538,7 @@ describe('audioRenderer', function () { console.info('AudioFrameworkRenderLog: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(async function (data) { console.info('AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -6605,28 +6605,28 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7500', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_32000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_U8, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-1C-32000-1SW.wav' await getFdRead(readPath, done); - var resultFlag = await playbackPromise_113(AudioRendererOptions, filePath); + let resultFlag = await playbackPromise_113(AudioRendererOptions, filePath); await sleep(100) console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -6644,34 +6644,34 @@ describe('audioRenderer', function () { */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - //var fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; + //let fpath = mediaDir+'/StarWars10s-2C-48000-4SW.wav'; readPath = 'StarWars10s-2C-48000-4SW.wav'; await getFdRead(readPath, done); - var resultFlag = true; + let resultFlag = true; console.info('AudioFrameworkRenderLog: AudioRenderer : Path : ' + readPath); console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -6736,26 +6736,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7700', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -6815,26 +6815,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7800', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -6910,26 +6910,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_7900', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -7007,26 +7007,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_8000', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -7104,26 +7104,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_8100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -7262,26 +7262,26 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it('SUB_MULTIMEDIA_AUDIO_RENDERER_PLAY_AUDIO_8600', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_RINGTONE, usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } - var resultFlag = false; + let resultFlag = false; - var audioRen; + let audioRen; let isPass = false; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; @@ -7381,18 +7381,18 @@ describe('audioRenderer', function () { * @tc.level : Level 2 */ it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0100", 2, async function (done) { - var audioStreamInfo = { + let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioRendererInfo = { + let audioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var audioRendererOptions = { + let audioRendererOptions = { streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo } @@ -7418,18 +7418,18 @@ describe('audioRenderer', function () { * @tc.require: Issue Number */ it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0200", 2, async function (done) { - var audioStreamInfo = { + let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioRendererInfo = { + let audioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var audioRendererOptions = { + let audioRendererOptions = { streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo } @@ -7455,18 +7455,18 @@ describe('audioRenderer', function () { * @tc.require: Issue Number */ it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0300", 2, async function (done) { - var audioStreamInfo = { + let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioRendererInfo = { + let audioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var audioRendererOptions = { + let audioRendererOptions = { streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo } @@ -7490,18 +7490,18 @@ describe('audioRenderer', function () { * @tc.require: Issue Number */ it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0400", 2, async function (done) { - var audioStreamInfo = { + let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioRendererInfo = { + let audioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var audioRendererOptions = { + let audioRendererOptions = { streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo } @@ -7525,18 +7525,18 @@ describe('audioRenderer', function () { * @tc.require: Issue Number */ it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0500", 2, async function (done) { - var audioStreamInfo = { + let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioRendererInfo = { + let audioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var audioRendererOptions = { + let audioRendererOptions = { streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo } @@ -7561,18 +7561,18 @@ describe('audioRenderer', function () { * @tc.require: Issue Number */ it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0600", 2, async function (done) { - var audioStreamInfo = { + let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var audioRendererInfo = { + let audioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_MUSIC, usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } - var audioRendererOptions = { + let audioRendererOptions = { streamInfo: audioStreamInfo, rendererInfo: audioRendererInfo } diff --git a/multimedia/audio/audio_js_standard/audioVoip/Test.json b/multimedia/audio/audio_js_standard/audioVoip/Test.json index 95a02f4356c60bc268d67fa0fe475226bd80410b..2568b7d462b88188622893ef018c5f0d85008250 100644 --- a/multimedia/audio/audio_js_standard/audioVoip/Test.json +++ b/multimedia/audio/audio_js_standard/audioVoip/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for audio manager Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "5500000", + "test-timeout": "550000", "package": "ohos.acts.multimedia.audio.audiovoip", "shell-timeout": "60000" }, diff --git a/multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js b/multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js index aec9e73c3a0bf10b007267d4a360423e145ecf5b..de79851c56de96554a5201e5f00bc326dc6df192 100644 --- a/multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js +++ b/multimedia/audio/audio_js_standard/audioVoip/src/main/js/test/AudioVOIP.test.js @@ -22,12 +22,12 @@ import * as audioTestBase from '../../../../../AudioTestBase' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; describe('audioVoip', function () { - var mediaDir; + let mediaDir; let fdRead; let readpath; let fdPath; let filePath; - const audioManager = audio.getAudioManager(); + const AUDIOMANAGER = audio.getAudioManager(); console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); beforeAll(async function () { @@ -99,10 +99,10 @@ describe('audioVoip', function () { } async function playbackPromise(AudioRendererOptions, pathName) { - var resultFlag = 'new'; + let resultFlag = 'new'; console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); - var audioRen; + let audioRen; await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { audioRen = data; console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); @@ -157,7 +157,7 @@ describe('audioVoip', function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); - var bufferSize; + let bufferSize; await audioRen.getBufferSize().then(async function (data) { console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); bufferSize = data; @@ -185,7 +185,7 @@ describe('audioVoip', function () { console.info('AudioFrameworkRenderLog: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(async function (data) { console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : Value : ' + data); }).catch((err) => { console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); @@ -235,10 +235,10 @@ describe('audioVoip', function () { async function recPromise(AudioCapturerOptions, fpath) { - var resultFlag = 'new'; + let resultFlag = 'new'; console.info('AudioFrameworkRecLog: Promise : Audio Recording Function'); - var audioCap; + let audioCap; await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { audioCap = data; @@ -305,10 +305,10 @@ describe('audioVoip', function () { console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); - var bufferSize = await audioCap.getBufferSize(); + let bufferSize = await audioCap.getBufferSize(); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); - var fd = fileio.openSync(fpath, 0o102, 0o777); + let fd = fileio.openSync(fpath, 0o102, 0o777); if (fd !== null) { console.info('AudioFrameworkRecLog: file fd created'); } @@ -328,13 +328,13 @@ describe('audioVoip', function () { return resultFlag; } await sleep(100); - var numBuffersToCapture = 45; + let numBuffersToCapture = 45; while (numBuffersToCapture) { console.info('AudioFrameworkRecLog: ---------READ BUFFER---------'); - var buffer = await audioCap.read(bufferSize, true); + let buffer = await audioCap.read(bufferSize, true); await sleep(50); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); - var number = fileio.writeSync(fd, buffer); + let number = fileio.writeSync(fd, buffer); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); await sleep(50); numBuffersToCapture--; @@ -376,26 +376,26 @@ describe('audioVoip', function () { */ it('SUB_MULTIMEDIA_AUDIO_VOIP_PLAY_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfo, rendererInfo: AudioRendererInfo } await getFdRead("StarWars10s-1C-44100-2SW.wav"); - var resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); + let resultFlag = await playbackPromise(AudioRendererOptions, filePath, audio.AudioScene.AUDIO_SCENE_VOICE_CHAT); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -413,25 +413,25 @@ describe('audioVoip', function () { */ it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_0100', 2, async function (done) { - var AudioStreamInfo = { + let AudioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfo, capturerInfo: AudioCapturerInfo } await getAbilityInfo("capture_js-44100-2C-16B.pcm"); - var resultFlag = await recPromise(AudioCapturerOptions, mediaDir); + let resultFlag = await recPromise(AudioCapturerOptions, mediaDir); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue(); @@ -448,37 +448,37 @@ describe('audioVoip', function () { */ it('SUB_MULTIMEDIA_AUDIO_VOIP_RECPLAY_0100', 2, async function (done) { - var AudioStreamInfoCap = { + let AudioStreamInfoCap = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_2, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioCapturerInfo = { + let AudioCapturerInfo = { source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION, capturerFlags: 0 } - var AudioCapturerOptions = { + let AudioCapturerOptions = { streamInfo: AudioStreamInfoCap, capturerInfo: AudioCapturerInfo } - var AudioStreamInfoRen = { + let AudioStreamInfoRen = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW } - var AudioRendererInfo = { + let AudioRendererInfo = { content: audio.ContentType.CONTENT_TYPE_SPEECH, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, rendererFlags: 0 } - var AudioRendererOptions = { + let AudioRendererOptions = { streamInfo: AudioStreamInfoRen, rendererInfo: AudioRendererInfo } @@ -489,7 +489,7 @@ describe('audioVoip', function () { readpath = 'StarWars10s-1C-44100-2SW.wav'; await getFdRead(readpath); - var resultFlag = await playbackPromise(AudioRendererOptions, readpath); + let resultFlag = await playbackPromise(AudioRendererOptions, readpath); await sleep(100); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); expect(resultFlag).assertTrue();