提交 2e083012 编写于 作者: Q qinliwen

<audio xts整改>

Signed-off-by: Nqinliwen <qinliwen3@huawei.com>
上级 489fe22c
...@@ -1313,17 +1313,29 @@ describe('audioRenderer', function () { ...@@ -1313,17 +1313,29 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: CALLBACK : Audio Playback Function'); console.info('AudioFrameworkRenderLog: CALLBACK : Audio Playback Function');
var audioRen; var audioRen;
let isPass = false;
audio.createAudioRenderer(AudioRendererOptions, (err, data) => { audio.createAudioRenderer(AudioRendererOptions, (err, data) => {
if (err) { if (err) {
console.error(`AudioFrameworkRenderLog: AudioRender Created : Error: ${err.message}`); LE24 = audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE;
resultFlag = false; LE32 = audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE;
let sampleFormat = AudioRendererOptions.streamInfo.sampleFormat;
if ((sampleFormat == LE24 || sampleFormat == LE32) && err.code == 202) {
isPass = true;
return;
}
resultFlag = false
} }
else { else {
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : SUCCESS'); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : SUCCESS');
audioRen = data; audioRen = data;
} }
}); });
console.log(`isPass: ${isPass}`);
if (isPass) {
resultFlag = true;
return resultFlag;
}
if (resultFlag == false) { if (resultFlag == false) {
console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag); console.info('AudioFrameworkRenderLog: resultFlag : ' + resultFlag);
return resultFlag; return resultFlag;
...@@ -7388,7 +7400,7 @@ describe('audioRenderer', function () { ...@@ -7388,7 +7400,7 @@ describe('audioRenderer', function () {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
...@@ -7537,7 +7549,7 @@ describe('audioRenderer', function () { ...@@ -7537,7 +7549,7 @@ describe('audioRenderer', function () {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_64000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_64000,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
...@@ -7574,7 +7586,7 @@ describe('audioRenderer', function () { ...@@ -7574,7 +7586,7 @@ describe('audioRenderer', function () {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_96000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_96000,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S32LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
...@@ -7685,7 +7697,7 @@ describe('audioRenderer', function () { ...@@ -7685,7 +7697,7 @@ describe('audioRenderer', function () {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_16000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_16000,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
...@@ -7762,7 +7774,7 @@ describe('audioRenderer', function () { ...@@ -7762,7 +7774,7 @@ describe('audioRenderer', function () {
var AudioStreamInfo = { var AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_24000,
channels: audio.AudioChannel.CHANNEL_2, channels: audio.AudioChannel.CHANNEL_2,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S24LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册