未验证 提交 0a2a6f9c 编写于 作者: O openharmony_ci 提交者: Gitee

!4818 audioXTS整改

Merge pull request !4818 from liuxueqi/OpenHarmony-3.1-Release
...@@ -78,14 +78,26 @@ describe('audioCapturer', function () { ...@@ -78,14 +78,26 @@ describe('audioCapturer', function () {
console.info('AudioFrameworkRecLog: Promise : Audio Recording Function'); console.info('AudioFrameworkRecLog: Promise : Audio Recording Function');
var audioCap; var audioCap;
let isPass = false;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) { await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
audioCap = data; audioCap = data;
console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS'); console.info('AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: SUCCESS');
}).catch((err) => { }).catch((err) => {
console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message); console.info('AudioFrameworkRecLog: AudioCapturer Created : ERROR : ' + err.message);
LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE;
LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE;
let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat;
if ((sampleFormat == LE24 || sampleFormat == LE32) && err.code == 202) {
isPass = true;
return;
}
return resultFlag; return resultFlag;
}); });
console.log("isPass:" + isPass);
if (isPass) {
resultFlag = true;
return resultFlag;
}
console.info('AudioFrameworkRecLog: AudioCapturer : Path : ' + fpath); console.info('AudioFrameworkRecLog: AudioCapturer : Path : ' + fpath);
...@@ -5657,7 +5669,7 @@ describe('audioCapturer', function () { ...@@ -5657,7 +5669,7 @@ describe('audioCapturer', function () {
}); });
await sleep(1000); await sleep(1000);
audioCapCallBack.on('periodReach', 1000, (position) => { audioCapCallBack.on('periodReach', 1000, (position) => {
if (position == "1000") { if (position == 1000) {
console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------');
console.info('AudioRenderLog: mark reached: ' + position); console.info('AudioRenderLog: mark reached: ' + position);
stateFlag = true; stateFlag = true;
...@@ -5812,7 +5824,7 @@ describe('audioCapturer', function () { ...@@ -5812,7 +5824,7 @@ describe('audioCapturer', function () {
}); });
await sleep(1000); await sleep(1000);
audioCapCallBack.on('periodReach', 1, (position) => { audioCapCallBack.on('periodReach', 1, (position) => {
if (position == "1") { if (position == 1) {
console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------'); console.info('AudioFrameworkRecLog: ---------ON TRIGGERED SUCCESSFULLY---------');
console.info('AudioRenderLog: mark reached: ' + position); console.info('AudioRenderLog: mark reached: ' + position);
stateFlag = true; stateFlag = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册