未验证 提交 053f448d 编写于 作者: O openharmony_ci 提交者: Gitee

!5428 【媒体子系统】audio部件规范性整改

Merge pull request !5428 from liuxueqi/master
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiocapturer", "package": "ohos.acts.multimedia.audio.audiocapturer",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiocapturerchangeInfo", "package": "ohos.acts.multimedia.audio.audiocapturerchangeInfo",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audioeventmanagement", "package": "ohos.acts.multimedia.audio.audioeventmanagement",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -19,8 +19,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -19,8 +19,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
describe('audioEventManagement', function () { describe('audioEventManagement', function () {
console.info('AudioFrameworkTest: Create AudioManger Object JS Framework'); console.info('AudioFrameworkTest: Create AudioManger Object JS Framework');
let audioManager = null; let audioManager = null;
var deviceRoleValue = null; let deviceRoleValue = null;
var deviceTypeValue = null; let deviceTypeValue = null;
function sleep(ms) { function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms)); return new Promise(resolve => setTimeout(resolve, ms));
} }
...@@ -34,8 +34,8 @@ describe('audioEventManagement', function () { ...@@ -34,8 +34,8 @@ describe('audioEventManagement', function () {
} }
} }
function displayDeviceProp(value, index, array) { function displayDeviceProp(value, index, array) {
var devRoleName; let devRoleName;
var devTypeName; let devTypeName;
if (value.deviceRole == 1) { if (value.deviceRole == 1) {
devRoleName = 'INPUT_DEVICE'; devRoleName = 'INPUT_DEVICE';
} }
...@@ -100,10 +100,8 @@ describe('audioEventManagement', function () { ...@@ -100,10 +100,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_MANAGER_GETDEVICES_0100', 0, async function (done) {
deviceRoleValue = null; const PROMISE = audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG)
deviceTypeValue = null; 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'); console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp); value.forEach(displayDeviceProp);
...@@ -116,7 +114,7 @@ describe('audioEventManagement', function () { ...@@ -116,7 +114,7 @@ describe('audioEventManagement', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await promise; await PROMISE;
done(); done();
}) })
...@@ -129,11 +127,8 @@ describe('audioEventManagement', function () { ...@@ -129,11 +127,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_OUTPUT_ENUM_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_OUTPUT_ENUM_0100', 0, async function (done) {
deviceRoleValue = null; const PROMISE = audioManager.getDevices(1)
deviceTypeValue = null; PROMISE.then(function (value) {
const promise = audioManager.getDevices(1)
promise.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG'); console.info('AudioFrameworkTest: Promise: getDevices OUTPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp); value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) { if (deviceTypeValue != null && deviceRoleValue != null) {
...@@ -145,7 +140,7 @@ describe('audioEventManagement', function () { ...@@ -145,7 +140,7 @@ describe('audioEventManagement', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await promise; await PROMISE;
done(); done();
}) })
...@@ -158,10 +153,8 @@ describe('audioEventManagement', function () { ...@@ -158,10 +153,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INPUT_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INPUT_0100', 0, async function (done) {
deviceRoleValue = null; const PROMISE = audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG);
deviceTypeValue = null; 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'); console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp); value.forEach(displayDeviceProp);
if (deviceTypeValue != null && deviceRoleValue != null) { if (deviceTypeValue != null && deviceRoleValue != null) {
...@@ -173,7 +166,7 @@ describe('audioEventManagement', function () { ...@@ -173,7 +166,7 @@ describe('audioEventManagement', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await promise; await PROMISE;
done(); done();
}) })
...@@ -186,10 +179,8 @@ describe('audioEventManagement', function () { ...@@ -186,10 +179,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INTPUT_ENUM_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_INTPUT_ENUM_0100', 0, async function (done) {
deviceRoleValue = null; const PROMISE = audioManager.getDevices(2);
deviceTypeValue = null; PROMISE.then(function (value) {
const promise = audioManager.getDevices(2);
promise.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG'); console.info('AudioFrameworkTest: Promise: getDevices INPUT_DEVICES_FLAG');
value.forEach(displayDeviceProp); value.forEach(displayDeviceProp);
...@@ -202,7 +193,7 @@ describe('audioEventManagement', function () { ...@@ -202,7 +193,7 @@ describe('audioEventManagement', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await promise; await PROMISE;
done(); done();
}) })
...@@ -215,10 +206,8 @@ describe('audioEventManagement', function () { ...@@ -215,10 +206,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_0100', 0, async function (done) {
deviceRoleValue = null; const PROMISE = audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG);
deviceTypeValue = null; 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'); console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp); value.forEach(displayDeviceProp);
...@@ -231,7 +220,7 @@ describe('audioEventManagement', function () { ...@@ -231,7 +220,7 @@ describe('audioEventManagement', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await promise; await PROMISE;
done(); done();
}) })
...@@ -244,10 +233,8 @@ describe('audioEventManagement', function () { ...@@ -244,10 +233,8 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_ENUM_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_PR_GETDEVICES_ALL_ENUM_0100', 0, async function (done) {
deviceRoleValue = null; const PROMISE = audioManager.getDevices(3);
deviceTypeValue = null; PROMISE.then(function (value) {
const promise = audioManager.getDevices(3);
promise.then(function (value) {
console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG'); console.info('AudioFrameworkTest: Promise: getDevices ALL_DEVICES_FLAG');
value.forEach(displayDeviceProp); value.forEach(displayDeviceProp);
...@@ -260,7 +247,7 @@ describe('audioEventManagement', function () { ...@@ -260,7 +247,7 @@ describe('audioEventManagement', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await promise; await PROMISE;
done(); done();
}) })
...@@ -273,8 +260,6 @@ describe('audioEventManagement', function () { ...@@ -273,8 +260,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_0100', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => { audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
if (err) { if (err) {
...@@ -306,8 +291,6 @@ describe('audioEventManagement', function () { ...@@ -306,8 +291,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 2 *@tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_OUTPUT_ENUM_0100', 2, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(1, (err, value) => { audioManager.getDevices(1, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG'); console.info('AudioFrameworkTest: Callback: getDevices OUTPUT_DEVICES_FLAG');
if (err) { if (err) {
...@@ -339,8 +322,6 @@ describe('audioEventManagement', function () { ...@@ -339,8 +322,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_0100', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => { audioManager.getDevices(audio.DeviceFlag.INPUT_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
if (err) { if (err) {
...@@ -373,8 +354,6 @@ describe('audioEventManagement', function () { ...@@ -373,8 +354,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_INPUT_ENUM_0100', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(2, (err, value) => { audioManager.getDevices(2, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG'); console.info('AudioFrameworkTest: Callback: getDevices INPUT_DEVICES_FLAG');
if (err) { if (err) {
...@@ -407,8 +386,6 @@ describe('audioEventManagement', function () { ...@@ -407,8 +386,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_0100', 0, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => { audioManager.getDevices(audio.DeviceFlag.ALL_DEVICES_FLAG, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
if (err) { if (err) {
...@@ -440,8 +417,6 @@ describe('audioEventManagement', function () { ...@@ -440,8 +417,6 @@ describe('audioEventManagement', function () {
*@tc.level : Level 2 *@tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, async function (done) { it('SUB_MULTIMEDIA_AUDIO_AUDIO_MANAGER_CB_GETDEVICES_ALL_ENUM_0100', 2, async function (done) {
deviceRoleValue = null;
deviceTypeValue = null;
audioManager.getDevices(3, (err, value) => { audioManager.getDevices(3, (err, value) => {
console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG'); console.info('AudioFrameworkTest: Callback: getDevices ALL_DEVICES_FLAG');
if (err) { if (err) {
...@@ -756,6 +731,4 @@ describe('audioEventManagement', function () { ...@@ -756,6 +731,4 @@ describe('audioEventManagement', function () {
await sleep(50); await sleep(50);
done(); done();
}) })
}) })
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiorendererchangeInfo", "package": "ohos.acts.multimedia.audio.audiorendererchangeInfo",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiomanager", "package": "ohos.acts.multimedia.audio.audiomanager",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "1500000",
"package": "ohos.acts.multimedia.audio.audiorenderer", "package": "ohos.acts.multimedia.audio.audiorenderer",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"description": "Configuration for audio manager Tests", "description": "Configuration for audio manager Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "5500000", "test-timeout": "550000",
"package": "ohos.acts.multimedia.audio.audiovoip", "package": "ohos.acts.multimedia.audio.audiovoip",
"shell-timeout": "60000" "shell-timeout": "60000"
}, },
......
...@@ -22,12 +22,12 @@ import * as audioTestBase from '../../../../../AudioTestBase' ...@@ -22,12 +22,12 @@ import * as audioTestBase from '../../../../../AudioTestBase'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('audioVoip', function () { describe('audioVoip', function () {
var mediaDir; let mediaDir;
let fdRead; let fdRead;
let readpath; let readpath;
let fdPath; let fdPath;
let filePath; let filePath;
const audioManager = audio.getAudioManager(); const AUDIOMANAGER = audio.getAudioManager();
console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework'); console.info('AudioFrameworkRenderLog: Create AudioManger Object JS Framework');
beforeAll(async function () { beforeAll(async function () {
...@@ -99,10 +99,10 @@ describe('audioVoip', function () { ...@@ -99,10 +99,10 @@ describe('audioVoip', function () {
} }
async function playbackPromise(AudioRendererOptions, pathName) { async function playbackPromise(AudioRendererOptions, pathName) {
var resultFlag = 'new'; let resultFlag = 'new';
console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function'); console.info('AudioFrameworkRenderLog: Promise : Audio Playback Function');
var audioRen; let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS'); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS');
...@@ -157,7 +157,7 @@ describe('audioVoip', function () { ...@@ -157,7 +157,7 @@ describe('audioVoip', function () {
console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state); console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state);
var bufferSize; let bufferSize;
await audioRen.getBufferSize().then(async function (data) { await audioRen.getBufferSize().then(async function (data) {
console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data); console.info('AudioFrameworkRenderLog: getBufferSize :SUCCESS ' + data);
bufferSize = data; bufferSize = data;
...@@ -185,7 +185,7 @@ describe('audioVoip', function () { ...@@ -185,7 +185,7 @@ describe('audioVoip', function () {
console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen); console.info('AudioFrameworkRenderLog:BufferAudioFramework: bytes read from file: ' + rlen);
await audioRen.write(buf); await audioRen.write(buf);
if (rlen > (totalSize / 2)) { 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); console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : Value : ' + data);
}).catch((err) => { }).catch((err) => {
console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message); console.info('AudioFrameworkRenderLog:AudioFrameworkAudioScene: getAudioScene : ERROR : ' + err.message);
...@@ -235,10 +235,10 @@ describe('audioVoip', function () { ...@@ -235,10 +235,10 @@ describe('audioVoip', function () {
async function recPromise(AudioCapturerOptions, fpath) { async function recPromise(AudioCapturerOptions, fpath) {
var resultFlag = 'new'; let resultFlag = 'new';
console.info('AudioFrameworkRecLog: Promise : Audio Recording Function'); console.info('AudioFrameworkRecLog: Promise : Audio Recording Function');
var audioCap; let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
audioCap = data; audioCap = data;
...@@ -305,10 +305,10 @@ describe('audioVoip', function () { ...@@ -305,10 +305,10 @@ describe('audioVoip', function () {
console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state); console.info('AudioFrameworkRecLog: AudioCapturer : STATE : ' + audioCap.state);
var bufferSize = await audioCap.getBufferSize(); let bufferSize = await audioCap.getBufferSize();
console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize); console.info('AudioFrameworkRecLog: buffer size: ' + bufferSize);
var fd = fileio.openSync(fpath, 0o102, 0o777); let fd = fileio.openSync(fpath, 0o102, 0o777);
if (fd !== null) { if (fd !== null) {
console.info('AudioFrameworkRecLog: file fd created'); console.info('AudioFrameworkRecLog: file fd created');
} }
...@@ -328,13 +328,13 @@ describe('audioVoip', function () { ...@@ -328,13 +328,13 @@ describe('audioVoip', function () {
return resultFlag; return resultFlag;
} }
await sleep(100); await sleep(100);
var numBuffersToCapture = 45; let numBuffersToCapture = 45;
while (numBuffersToCapture) { while (numBuffersToCapture) {
console.info('AudioFrameworkRecLog: ---------READ BUFFER---------'); console.info('AudioFrameworkRecLog: ---------READ BUFFER---------');
var buffer = await audioCap.read(bufferSize, true); let buffer = await audioCap.read(bufferSize, true);
await sleep(50); await sleep(50);
console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------'); console.info('AudioFrameworkRecLog: ---------WRITE BUFFER---------');
var number = fileio.writeSync(fd, buffer); let number = fileio.writeSync(fd, buffer);
console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number); console.info('AudioFrameworkRecLog:BufferRecLog: data written: ' + number);
await sleep(50); await sleep(50);
numBuffersToCapture--; numBuffersToCapture--;
...@@ -376,26 +376,26 @@ describe('audioVoip', function () { ...@@ -376,26 +376,26 @@ describe('audioVoip', function () {
*/ */
it('SUB_MULTIMEDIA_AUDIO_VOIP_PLAY_0100', 2, async function (done) { it('SUB_MULTIMEDIA_AUDIO_VOIP_PLAY_0100', 2, async function (done) {
var AudioStreamInfo = { let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
var AudioRendererInfo = { let AudioRendererInfo = {
content: audio.ContentType.CONTENT_TYPE_SPEECH, content: audio.ContentType.CONTENT_TYPE_SPEECH,
usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION,
rendererFlags: 0 rendererFlags: 0
} }
var AudioRendererOptions = { let AudioRendererOptions = {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
await getFdRead("StarWars10s-1C-44100-2SW.wav"); 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); await sleep(100);
console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag);
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
...@@ -413,25 +413,25 @@ describe('audioVoip', function () { ...@@ -413,25 +413,25 @@ describe('audioVoip', function () {
*/ */
it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_0100', 2, async function (done) { it('SUB_MULTIMEDIA_AUDIO_VOIP_REC_0100', 2, async function (done) {
var AudioStreamInfo = { let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
var AudioCapturerInfo = { let AudioCapturerInfo = {
source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION, source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION,
capturerFlags: 0 capturerFlags: 0
} }
var AudioCapturerOptions = { let AudioCapturerOptions = {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
capturerInfo: AudioCapturerInfo capturerInfo: AudioCapturerInfo
} }
await getAbilityInfo("capture_js-44100-2C-16B.pcm"); await getAbilityInfo("capture_js-44100-2C-16B.pcm");
var resultFlag = await recPromise(AudioCapturerOptions, mediaDir); let resultFlag = await recPromise(AudioCapturerOptions, mediaDir);
await sleep(100); await sleep(100);
console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag);
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
...@@ -448,37 +448,37 @@ describe('audioVoip', function () { ...@@ -448,37 +448,37 @@ describe('audioVoip', function () {
*/ */
it('SUB_MULTIMEDIA_AUDIO_VOIP_RECPLAY_0100', 2, async function (done) { it('SUB_MULTIMEDIA_AUDIO_VOIP_RECPLAY_0100', 2, async function (done) {
var AudioStreamInfoCap = { let AudioStreamInfoCap = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
var AudioCapturerInfo = { let AudioCapturerInfo = {
source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION, source: audio.SourceType.SOURCE_TYPE_VOICE_COMMUNICATION,
capturerFlags: 0 capturerFlags: 0
} }
var AudioCapturerOptions = { let AudioCapturerOptions = {
streamInfo: AudioStreamInfoCap, streamInfo: AudioStreamInfoCap,
capturerInfo: AudioCapturerInfo capturerInfo: AudioCapturerInfo
} }
var AudioStreamInfoRen = { let AudioStreamInfoRen = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
var AudioRendererInfo = { let AudioRendererInfo = {
content: audio.ContentType.CONTENT_TYPE_SPEECH, content: audio.ContentType.CONTENT_TYPE_SPEECH,
usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION, usage: audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION,
rendererFlags: 0 rendererFlags: 0
} }
var AudioRendererOptions = { let AudioRendererOptions = {
streamInfo: AudioStreamInfoRen, streamInfo: AudioStreamInfoRen,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
...@@ -489,7 +489,7 @@ describe('audioVoip', function () { ...@@ -489,7 +489,7 @@ describe('audioVoip', function () {
readpath = 'StarWars10s-1C-44100-2SW.wav'; readpath = 'StarWars10s-1C-44100-2SW.wav';
await getFdRead(readpath); await getFdRead(readpath);
var resultFlag = await playbackPromise(AudioRendererOptions, readpath); let resultFlag = await playbackPromise(AudioRendererOptions, readpath);
await sleep(100); await sleep(100);
console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag);
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册